From c9c772ddf2618d937cf0046a74f2075ddd73e64c Mon Sep 17 00:00:00 2001 From: Patrick Johnson Date: Tue, 14 Jun 2022 17:44:26 -0700 Subject: [PATCH] GEODE-10261: VMProvider.invokeAsync uses appropriate parameterization. (#7631) * Cleanup use of AsyncInvocation. * Add generic parameters to AsyncInvocation variables where they were missing. * Cleaned up by changing single element arrays to variables. --- .../geode/cache/ConnectionPoolDUnitTest.java | 10 +- .../CacheServerSSLConnectionDUnitTest.java | 3 +- .../management/MemoryThresholdsDUnitTest.java | 8 +- .../MemoryThresholdsOffHeapDUnitTest.java | 4 +- .../PartitionRegionHelperDUnitTest.java | 12 +- .../dunit/CompactRangeIndexDUnitTest.java | 2 +- .../PdxLocalQueryVersionedClassDUnitTest.java | 4 +- .../dunit/PdxMultiThreadQueryDUnitTest.java | 2 +- .../QueryDataInconsistencyDUnitTest.java | 10 +- .../query/dunit/QueryIndexDUnitTest.java | 4 +- .../dunit/QueryIndexUsingXMLDUnitTest.java | 14 +- ...ourceManagerWithQueryMonitorDUnitTest.java | 14 +- ...entIndexInitOnOverflowRegionDUnitTest.java | 10 +- ...exOperationsOnOverflowRegionDUnitTest.java | 24 ++-- ...ateWithInplaceObjectModFalseDUnitTest.java | 24 ++-- ...ncurrentIndexUpdateWithoutWLDUnitTest.java | 36 +++--- .../IndexTrackingQueryObserverDUnitTest.java | 8 +- ...ializeIndexEntryDestroyQueryDUnitTest.java | 7 +- .../index/MultiIndexCreationDUnitTest.java | 4 +- .../PRBasicIndexCreationDUnitTest.java | 8 +- .../PRBasicMultiIndexCreationDUnitTest.java | 4 +- .../partitioned/PRBasicQueryDUnitTest.java | 4 +- .../PRQueryRegionCloseDUnitTest.java | 2 +- .../PRQueryRegionDestroyedDUnitTest.java | 2 +- .../geode/cache30/CacheMapTxnDUnitTest.java | 16 +-- .../geode/cache30/ClearMultiVmDUnitTest.java | 6 +- .../cache30/ClientServerCCEDUnitTest.java | 4 +- .../DistributedAckRegionCCEDUnitTest.java | 2 +- .../DistributedNoAckRegionCCEDUnitTest.java | 8 +- .../geode/cache30/GlobalRegionDUnitTest.java | 2 +- .../geode/cache30/PutAllMultiVmDUnitTest.java | 12 +- .../geode/cache30/ReconnectDUnitTest.java | 4 +- ...nectWithClusterConfigurationDUnitTest.java | 8 +- .../geode/cache30/SearchAndLoadDUnitTest.java | 2 +- .../DistributedLockServiceDUnitTest.java | 16 +-- .../distributed/GrantorFailoverDUnitTest.java | 10 +- .../GemFireDeadlockDetectorDUnitTest.java | 14 +- .../cache/ClientServerGetAllDUnitTest.java | 4 +- ...verTransactionFailoverDistributedTest.java | 2 +- .../ConcurrentDestroySubRegionDUnitTest.java | 4 +- .../cache/ConnectDisconnectDUnitTest.java | 2 +- ...DestroyRegionDuringGIIDistributedTest.java | 8 +- .../internal/cache/GIIDeltaDUnitTest.java | 60 ++++----- .../cache/GIIFlowControlDUnitTest.java | 6 +- .../cache/InterruptClientServerDUnitTest.java | 2 +- .../internal/cache/InterruptsDUnitTest.java | 2 +- .../PREntryIdleExpirationDistributedTest.java | 2 +- .../PREntrySetIteratorRegressionTest.java | 4 +- ...onBucketCreationDistributionDUnitTest.java | 4 +- .../PartitionedRegionCreationDUnitTest.java | 4 +- .../PartitionedRegionDestroyDUnitTest.java | 2 +- ...ionLowBucketRedundancyDistributedTest.java | 4 +- .../PersistentRegionRecoveryDUnitTest.java | 6 +- .../internal/cache/PutAllGlobalDUnitTest.java | 88 ++++++------- ...nceWhileCreatingRegionDistributedTest.java | 4 +- .../internal/cache/RemoveGlobalDUnitTest.java | 4 +- ...ateEntryIdleExpirationDistributedTest.java | 6 +- .../TransactionsWithGIIDistributedTest.java | 6 +- .../cache/backup/BackupDistributedTest.java | 16 +-- .../RebalanceOperationDistributedTest.java | 4 +- ...butedRegionFunctionExecutionDUnitTest.java | 2 +- .../cache/execute/FunctionRetryTestBase.java | 2 +- ...erverRegionFunctionExecutionDUnitTest.java | 17 --- ...ionFunctionExecutionFailoverDUnitTest.java | 28 ++-- ...onExecutionNoSingleHopDistributedTest.java | 30 +---- ...ExecutionSelectorNoSingleHopDUnitTest.java | 54 +++----- ...onFunctionExecutionSingleHopDUnitTest.java | 46 ++----- .../cache/execute/PRClientServerTestBase.java | 18 +++ .../cache/execute/PRColocationDUnitTest.java | 4 +- .../internal/cache/ha/HAGIIBugDUnitTest.java | 2 +- ...catedPartitionedRegionDistributedTest.java | 2 +- ...itionHangsDuringRestartRegressionTest.java | 3 +- .../PersistentPartitionedRegionTestBase.java | 2 +- ...itionedRegionWithTransactionDUnitTest.java | 6 +- .../partitioned/ShutdownAllDUnitTest.java | 32 ++--- .../fixed/FixedPartitioningDUnitTest.java | 6 +- .../PersistentRVVRecoveryDUnitTest.java | 6 +- .../PersistentRecoveryOrderDUnitTest.java | 2 +- .../PersistentReplicatedTestBase.java | 11 +- .../tier/sockets/SlowDispatcherDUnitTest.java | 2 +- .../AsyncEventQueueStatsDUnitTest.java | 9 +- ...EventListenerStopStartDistributedTest.java | 8 +- .../ConcurrentAsyncEventQueueDUnitTest.java | 6 +- .../jta/dunit/IdleTimeOutDUnitTest.java | 2 +- .../jta/dunit/LoginTimeOutDUnitTest.java | 4 +- .../jta/dunit/MaxPoolSizeDUnitTest.java | 2 +- .../dunit/TransactionTimeOutDUnitTest.java | 4 +- .../dunit/TxnManagerMultiThreadDUnitTest.java | 4 +- .../jta/dunit/TxnTimeOutDUnitTest.java | 14 +- .../statistics/StatisticsDistributedTest.java | 4 +- .../management/DiskManagementDUnitTest.java | 15 +-- .../security/MultiClientDUnitTest.java | 8 +- .../internal/security/MultiGfshDUnitTest.java | 4 +- .../geode/pdx/PdxSerializableDUnitTest.java | 8 +- .../geode/pdx/PdxTypeGenerationDUnitTest.java | 4 +- .../AuthExpirationMultiServerDUnitTest.java | 2 +- .../ClientContainsKeyAuthDUnitTest.java | 4 +- .../security/ClientGetEntryAuthDUnitTest.java | 4 +- .../security/ClientGetPutAuthDUnitTest.java | 6 +- .../ClientRegisterInterestAuthDUnitTest.java | 18 +-- .../ClientRemoveAllAuthDUnitTest.java | 4 +- ...ClientUnregisterInterestAuthDUnitTest.java | 2 +- .../geode/ClusterCommunicationsDUnitTest.java | 7 +- ...ollingUpgradeConcurrentPutsReplicated.java | 4 +- .../cache/query/cq/dunit/CqDataDUnitTest.java | 121 +++++++++--------- .../cq/dunit/CqDataUsingPoolDUnitTest.java | 2 +- .../query/cq/dunit/CqStateDUnitTest.java | 2 +- .../dunit/PartitionedRegionTxDUnitTest.java | 4 +- .../query/dunit/QueryMonitorDUnitTest.java | 6 +- .../AsyncInvokeRunnableExampleTest.java | 6 +- .../dunit/tests/BasicDistributedTest.java | 37 +++--- .../test/dunit/tests/VMDistributedTest.java | 10 +- .../cache/query/dunit/HelperTestCase.java | 2 +- .../geode/cache30/MultiVMRegionTestCase.java | 32 ++--- .../geode/test/junit/rules/VMProvider.java | 6 +- .../lucene/LuceneIndexCreationDUnitTest.java | 4 +- .../lucene/LuceneIndexDestroyDUnitTest.java | 8 +- .../lucene/LuceneQueriesReindexDUnitTest.java | 30 ++--- ...onCreatedBeforeReindexClientDUnitTest.java | 4 +- ...thRegionCreatedBeforeReindexDUnitTest.java | 6 +- ...thRegionCreatedBeforeReindexDUnitTest.java | 12 +- .../DestroyLuceneIndexCommandsDUnitTest.java | 8 +- ...fulWhenAllServersRollToCurrentVersion.java | 4 +- .../geode/internal/cache/wan/WANTestBase.java | 16 +-- ...tParallelGatewaySenderDistributedTest.java | 8 +- ...lelGatewaySenderOperation_1_DUnitTest.java | 24 ++-- .../ConcurrentWANPropagation_1_DUnitTest.java | 10 +- .../ConcurrentWANPropagation_2_DUnitTest.java | 4 +- .../CommonParallelGatewaySenderDUnitTest.java | 8 +- ...ANConcurrencyCheckForDestroyDUnitTest.java | 10 +- .../cache/wan/misc/PDXNewWanDUnitTest.java | 2 +- ...egion_ParallelWANPersistenceDUnitTest.java | 47 +++---- ...egion_ParallelWANPropagationDUnitTest.java | 21 +-- ...wnAllPersistentGatewaySenderDUnitTest.java | 54 ++++---- .../wan/misc/WanAutoDiscoveryDUnitTest.java | 22 ++-- ...sistenceEnabledGatewaySenderDUnitTest.java | 67 +++++----- ...opagationConcurrentOpsDistributedTest.java | 16 +-- .../ParallelWANStatsDistributedTest.java | 6 +- ...GatewaySenderAlterOperationsDUnitTest.java | 4 +- ...waySenderDistributedDeadlockDUnitTest.java | 32 ++--- ...atewaySenderOperationsDistributedTest.java | 18 +-- ...sistenceEnabledGatewaySenderDUnitTest.java | 12 +- .../serial/SerialWANPropagationDUnitTest.java | 34 ++--- .../serial/SerialWANStatsDistributedTest.java | 18 +-- 144 files changed, 831 insertions(+), 896 deletions(-) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/ConnectionPoolDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/ConnectionPoolDUnitTest.java index 3a7f466fd4e6..3d3c799527ab 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/ConnectionPoolDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/ConnectionPoolDUnitTest.java @@ -466,8 +466,8 @@ public void run2() throws CacheException { }; logger.info("before initialize client"); - AsyncInvocation inv2 = vm2.invokeAsync("Initialize Client", initializeClient); - AsyncInvocation inv3 = vm3.invokeAsync("Initialize Client", initializeClient); + AsyncInvocation inv2 = vm2.invokeAsync("Initialize Client", initializeClient); + AsyncInvocation inv3 = vm3.invokeAsync("Initialize Client", initializeClient); inv2.await(); inv3.await(); @@ -526,7 +526,7 @@ public void close() {} // Initialize each client with entries (so that afterInvalidate is called) logger.info("before initialize client"); - AsyncInvocation inv2 = client.invokeAsync("Initialize Client", () -> { + AsyncInvocation inv2 = client.invokeAsync("Initialize Client", () -> { Region region = getRootRegion().getSubregion(name); PoolStats stats = ((PoolImpl) PoolManager.find(poolName)).getStats(); int oldConnects = stats.getConnects(); @@ -780,8 +780,8 @@ public void basicTestLifetimeExpire() throws CacheException, InterruptedException { final String name = getName(); - AsyncInvocation putAI = null; - AsyncInvocation putAI2 = null; + AsyncInvocation putAI = null; + AsyncInvocation putAI2 = null; try { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/CacheServerSSLConnectionDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/CacheServerSSLConnectionDUnitTest.java index 5faf23add6fa..a2506a695dbb 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/CacheServerSSLConnectionDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/client/internal/CacheServerSSLConnectionDUnitTest.java @@ -479,7 +479,8 @@ public void clientSlowToHandshakeDoesNotBlockServer() throws Throwable { String hostName = getHostName(); - AsyncInvocation slowAsync = slowClientVM.invokeAsync(() -> connectToServer(hostName, port)); + AsyncInvocation slowAsync = + slowClientVM.invokeAsync(() -> connectToServer(hostName, port)); try { getBlackboard().waitForGate("serverIsBlocked", 60, TimeUnit.SECONDS); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/management/MemoryThresholdsDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/management/MemoryThresholdsDUnitTest.java index 3b8f6ad5d63a..e9277aae62f9 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/management/MemoryThresholdsDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/management/MemoryThresholdsDUnitTest.java @@ -2016,8 +2016,8 @@ public void testDRLoadRejection() throws Exception { final int fakeHeapMaxSize = 1000; // Make sure the desired VMs will have a fresh DS. - AsyncInvocation d1 = replicate1.invokeAsync(JUnit4DistributedTestCase::disconnectFromDS); - AsyncInvocation d2 = replicate2.invokeAsync(JUnit4DistributedTestCase::disconnectFromDS); + AsyncInvocation d1 = replicate1.invokeAsync(JUnit4DistributedTestCase::disconnectFromDS); + AsyncInvocation d2 = replicate2.invokeAsync(JUnit4DistributedTestCase::disconnectFromDS); d1.join(); assertFalse(d1.exceptionOccurred()); d2.join(); @@ -2232,8 +2232,8 @@ public void testPRLoadRejection() throws Exception { final int fakeHeapMaxSize = 1000; // Make sure the desired VMs will have a fresh DS. - AsyncInvocation d0 = accessor.invokeAsync(JUnit4DistributedTestCase::disconnectFromDS); - AsyncInvocation d1 = ds1.invokeAsync(JUnit4DistributedTestCase::disconnectFromDS); + AsyncInvocation d0 = accessor.invokeAsync(JUnit4DistributedTestCase::disconnectFromDS); + AsyncInvocation d1 = ds1.invokeAsync(JUnit4DistributedTestCase::disconnectFromDS); d0.join(); assertFalse(d0.exceptionOccurred()); d1.join(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/management/MemoryThresholdsOffHeapDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/management/MemoryThresholdsOffHeapDUnitTest.java index 8ba1438ba939..fe58e4317f36 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/management/MemoryThresholdsOffHeapDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/management/MemoryThresholdsOffHeapDUnitTest.java @@ -529,8 +529,8 @@ public void testDRLoadRejection() throws Exception { final String rName = getUniqueName(); // Make sure the desired VMs will have a fresh DS. - AsyncInvocation d1 = replicate1.invokeAsync(JUnit4DistributedTestCase::disconnectFromDS); - AsyncInvocation d2 = replicate2.invokeAsync(JUnit4DistributedTestCase::disconnectFromDS); + AsyncInvocation d1 = replicate1.invokeAsync(JUnit4DistributedTestCase::disconnectFromDS); + AsyncInvocation d2 = replicate2.invokeAsync(JUnit4DistributedTestCase::disconnectFromDS); d1.join(); assertFalse(d1.exceptionOccurred()); d2.join(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/partition/PartitionRegionHelperDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/partition/PartitionRegionHelperDUnitTest.java index bfa08018fc80..b7f36f0b5595 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/partition/PartitionRegionHelperDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/partition/PartitionRegionHelperDUnitTest.java @@ -98,9 +98,9 @@ public void run() { } }; - AsyncInvocation future1 = vm0.invokeAsync(assignBuckets); - AsyncInvocation future2 = vm1.invokeAsync(assignBuckets); - AsyncInvocation future3 = vm2.invokeAsync(assignBuckets); + AsyncInvocation future1 = vm0.invokeAsync(assignBuckets); + AsyncInvocation future2 = vm1.invokeAsync(assignBuckets); + AsyncInvocation future3 = vm2.invokeAsync(assignBuckets); future1.join(60 * 1000); future2.join(60 * 1000); future3.join(60 * 1000); @@ -220,9 +220,9 @@ public void run() { } }; - AsyncInvocation future1 = vm0.invokeAsync(assignBuckets); - AsyncInvocation future2 = vm1.invokeAsync(assignBuckets); - AsyncInvocation future3 = vm2.invokeAsync(assignBuckets); + AsyncInvocation future1 = vm0.invokeAsync(assignBuckets); + AsyncInvocation future2 = vm1.invokeAsync(assignBuckets); + AsyncInvocation future3 = vm2.invokeAsync(assignBuckets); future1.join(); future2.join(); future3.join(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/CompactRangeIndexDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/CompactRangeIndexDUnitTest.java index faa99b8deacb..a821e9aa5bdd 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/CompactRangeIndexDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/CompactRangeIndexDUnitTest.java @@ -149,7 +149,7 @@ public void run2() { public void doQuery() throws InterruptedException { final String[] qarr = {"1", "519", "181"}; - AsyncInvocation as0 = vm0.invokeAsync(new CacheSerializableRunnable("Executing query") { + AsyncInvocation as0 = vm0.invokeAsync(new CacheSerializableRunnable("Executing query") { @Override public void run2() throws CacheException { for (int i = 0; i < 50; i++) { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java index e7cbc15d1939..ae8b52892b4d 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PdxLocalQueryVersionedClassDUnitTest.java @@ -103,7 +103,7 @@ public Object call() throws Exception { // Execute same query remotely from client using 2 threads // Since this is a bind query, the query object will be shared // between the 2 threads. - AsyncInvocation a1 = client.invokeAsync(new SerializableCallable("Query from client") { + AsyncInvocation a1 = client.invokeAsync(new SerializableCallable("Query from client") { @Override public Object call() throws Exception { QueryService qs = null; @@ -129,7 +129,7 @@ public Object call() throws Exception { } }); - AsyncInvocation a2 = client.invokeAsync(new SerializableCallable("Query from client") { + AsyncInvocation a2 = client.invokeAsync(new SerializableCallable("Query from client") { @Override public Object call() throws Exception { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PdxMultiThreadQueryDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PdxMultiThreadQueryDUnitTest.java index 6e1bc7eb62e6..7e42fe45383e 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PdxMultiThreadQueryDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/PdxMultiThreadQueryDUnitTest.java @@ -158,7 +158,7 @@ public void testClientServerQueryUsingRemoteQueryService() new int[] {port0, port1, port2}, true); final int size = 100; - AsyncInvocation[] asyncInvocationArray = new AsyncInvocation[size]; + AsyncInvocation[] asyncInvocationArray = new AsyncInvocation[size]; for (int i = 0; i < size; i++) { asyncInvocationArray[i] = client.invokeAsync(() -> { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryDataInconsistencyDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryDataInconsistencyDUnitTest.java index aca4c13320ed..7cb2e84ce65c 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryDataInconsistencyDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryDataInconsistencyDUnitTest.java @@ -110,7 +110,7 @@ public void testCompactRangeIndex() { // Invoke update from client and stop in updateIndex // firesultSett before updating the RegionEntry and second after updating // the RegionEntry. - AsyncInvocation putThread = server.invokeAsync("update a Region Entry", () -> { + AsyncInvocation putThread = server.invokeAsync("update a Region Entry", () -> { Region repRegion = cacheRule.getCache().getRegion(repRegionName); IndexManager.testHook = new IndexManagerTestHook(); repRegion.put(new Integer("1"), new Portfolio(cntDest + 1)); @@ -196,7 +196,7 @@ public void testRangeIndex() { // Invoke update from client and stop in updateIndex // firesultSett before updating the RegionEntry and second after updating // the RegionEntry. - AsyncInvocation putThread = server.invokeAsync("update a Region Entry", () -> { + AsyncInvocation putThread = server.invokeAsync("update a Region Entry", () -> { Cache cache = cacheRule.getCache(); Region repRegion = cache.getRegion(repRegionName); IndexManager.testHook = new IndexManagerTestHook(); @@ -281,7 +281,7 @@ public void testRangeIndexWithIndexAndQueryFromClauseMisMatch() { // Invoke update from client and stop in updateIndex // firesultSett before updating the RegionEntry and second after updating // the RegionEntry. - AsyncInvocation putThread = server.invokeAsync("update a Region Entry", () -> { + AsyncInvocation putThread = server.invokeAsync("update a Region Entry", () -> { Region repRegion = cacheRule.getCache().getRegion(repRegionName); IndexManager.testHook = new IndexManagerTestHook(); // This portfolio with same ID must have different positions. @@ -361,7 +361,7 @@ public void testRangeIndexWithIndexAndQueryFromClauseMisMatch2() { // Invoke update from client and stop in updateIndex // firesultSett before updating the RegionEntry and second after updating // the RegionEntry. - AsyncInvocation putThread = server.invokeAsync("update a Region Entry", () -> { + AsyncInvocation putThread = server.invokeAsync("update a Region Entry", () -> { Cache cache = cacheRule.getCache(); Region repRegion = cache.getRegion(repRegionName); IndexManager.testHook = new IndexManagerTestHook(); @@ -420,7 +420,7 @@ public void testRangeIndexWithIndexAndQueryFromClauseMisMatch2() { await().until(joinThread(putThread)); } - private Callable joinThread(AsyncInvocation thread) { + private Callable joinThread(AsyncInvocation thread) { return () -> { try { thread.join(100L); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryIndexDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryIndexDUnitTest.java index d106a55a6b03..bc2304cddfe4 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryIndexDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryIndexDUnitTest.java @@ -155,8 +155,8 @@ public void createIndexesAndUpdatesAndThenValidate() throws InterruptedException Host host = Host.getHost(0); VM vm0 = host.getVM(0); - AsyncInvocation ai1 = null; - AsyncInvocation ai2 = null; + AsyncInvocation ai1 = null; + AsyncInvocation ai2 = null; vm0.invoke(QueryIndexDUnitTest::createIndex); vm0.invoke(QueryIndexDUnitTest::validateIndexUsage); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java index 6da1033fc448..1165e6b1eff3 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryIndexUsingXMLDUnitTest.java @@ -138,8 +138,8 @@ public void testCreateIndexThroughXML() throws Exception { getLogWriter().info("Creating index using an xml file name : " + CACHE_XML_FILE_NAME); - AsyncInvocation async0 = vm0.invokeAsync(createIndexThroughXML(NAME)); - AsyncInvocation async1 = vm1.invokeAsync(createIndexThroughXML(NAME)); + AsyncInvocation async0 = vm0.invokeAsync(createIndexThroughXML(NAME)); + AsyncInvocation async1 = vm1.invokeAsync(createIndexThroughXML(NAME)); async1.await(); async0.await(); @@ -365,7 +365,7 @@ public void testCreateAsyncIndexWhileDoingGII() throws Exception { getLogWriter().info("Creating index using an xml file name : " + CACHE_XML_FILE_NAME); - AsyncInvocation async0 = vm0.invokeAsync(createIndexThroughXML(NAME)); + AsyncInvocation async0 = vm0.invokeAsync(createIndexThroughXML(NAME)); async0.await(); @@ -374,7 +374,7 @@ public void testCreateAsyncIndexWhileDoingGII() throws Exception { vm1.invoke(setTestHook()); - AsyncInvocation async1 = vm1.invokeAsync(createIndexThroughXML(NAME)); + AsyncInvocation async1 = vm1.invokeAsync(createIndexThroughXML(NAME)); vm0.invoke(prIndexCreationCheck(NAME, STATUS_INDEX, 50)); @@ -451,7 +451,7 @@ public void testCreateAsyncIndexWhileDoingGIIAndQuery() throws Exception { getLogWriter().info("Creating index using an xml file name : " + CACHE_XML_FILE_NAME); - AsyncInvocation async0 = vm0.invokeAsync(createIndexThroughXML(NAME)); + AsyncInvocation async0 = vm0.invokeAsync(createIndexThroughXML(NAME)); async0.await(); @@ -460,7 +460,7 @@ public void testCreateAsyncIndexWhileDoingGIIAndQuery() throws Exception { vm1.invoke(setTestHook()); - AsyncInvocation async1 = vm1.invokeAsync(createIndexThroughXML(NAME)); + AsyncInvocation async1 = vm1.invokeAsync(createIndexThroughXML(NAME)); async1.await(); async0.await(); @@ -496,7 +496,7 @@ public void testCreateAsyncIndexWhileDoingGIIAndCompareQueryResults() throws Exc vm0.invokeAsync(loadRegion(NAME, 500)); vm0.invokeAsync(loadRegion(REP_REG_NAME, 500)); - AsyncInvocation async0 = vm0.invokeAsync(loadRegion(PERSISTENT_REG_NAME, 500)); + AsyncInvocation async0 = vm0.invokeAsync(loadRegion(PERSISTENT_REG_NAME, 500)); vm0.invokeAsync(loadRegion(NO_INDEX_REP_REG, 500)); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java index 2967e8b9edce..a52595123986 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java @@ -269,7 +269,7 @@ public void testPRGatherCancellation() throws Throwable { DefaultQuery.testHook = getPauseHook(true, controller); }); // remove from here to .... - AsyncInvocation queryExecution1 = executeQueryOnClient(client); + AsyncInvocation queryExecution1 = executeQueryOnClient(client); // Gives async invocation a chance to start Thread.sleep(1000); @@ -291,7 +291,7 @@ public void testPRGatherCancellation() throws Throwable { }); // We simulate a low memory/critical heap percentage hit setHeapToCriticalAndReleaseLatch(server1); - AsyncInvocation queryExecution = executeQueryOnClient(client); + AsyncInvocation queryExecution = executeQueryOnClient(client); await().untilAsserted(() -> assertThat(queryExecution.get()).isEqualTo(0)); verifyDroppedObjectsAndSetHeapToNormal(server1); @@ -302,7 +302,7 @@ public void testPRGatherCancellation() throws Throwable { } } - private AsyncInvocation executeQueryOnClient(VM client) { + private AsyncInvocation executeQueryOnClient(VM client) { return client.invokeAsync("execute query from client", () -> { try { Query query1 = @@ -659,7 +659,7 @@ private void doTestCriticalHeapAndQueryTimeout(VM server, VM client, throws InterruptedException { createLatchTestHook(server, hitCriticalThreshold, VM.getController()); - AsyncInvocation queryExecution = invokeClientQuery(client, + AsyncInvocation queryExecution = invokeClientQuery(client, disabledQueryMonitorForLowMem, queryTimeout, hitCriticalThreshold, VM.getController()); criticalMemoryCountDownLatch.await(); @@ -684,7 +684,7 @@ private void doTestCriticalHeapAndQueryTimeout(VM server, VM client, private void executeQueryWithCriticalHeapCalledAfterTimeout(VM server, VM client) throws InterruptedException { createLatchTestHook(server, false, VM.getController()); - AsyncInvocation queryExecution = executeQueryWithTimeout(client); + AsyncInvocation queryExecution = executeQueryWithTimeout(client); // Wait till the timeout expires on the query Thread.sleep(1 + TEST_QUERY_TIMEOUT); @@ -702,7 +702,7 @@ private void executeQueryWithCriticalHeapCalledAfterTimeout(VM server, VM client } - private AsyncInvocation executeQueryWithTimeout(VM client) { + private AsyncInvocation executeQueryWithTimeout(VM client) { return client.invokeAsync("execute query from client", () -> { QueryService qs; try { @@ -738,7 +738,7 @@ private AsyncInvocation executeQueryWithTimeout(VM client) { } - private AsyncInvocation invokeClientQuery(VM client, + private AsyncInvocation invokeClientQuery(VM client, final boolean disabledQueryMonitorForLowMem, final int queryTimeout, final boolean hitCriticalThreshold, diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexInitOnOverflowRegionDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexInitOnOverflowRegionDUnitTest.java index 01e737383a15..649a1020c490 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexInitOnOverflowRegionDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexInitOnOverflowRegionDUnitTest.java @@ -139,7 +139,7 @@ public void run2() throws CacheException { // Start changing the value in Region which should turn into a deadlock if // the fix is not there - AsyncInvocation asyncInv1 = + AsyncInvocation asyncInv1 = vm0.invokeAsync(new CacheSerializableRunnable("Change value in region") { @Override @@ -164,7 +164,7 @@ public void run2() throws CacheException { } }); - AsyncInvocation asyncInv2 = + AsyncInvocation asyncInv2 = vm0.invokeAsync(new CacheSerializableRunnable("Run query on region") { @Override @@ -286,7 +286,7 @@ public void run2() throws CacheException { } }); - AsyncInvocation asyncInv1 = + AsyncInvocation asyncInv1 = vm1.invokeAsync(new CacheSerializableRunnable("Change value in region") { @Override @@ -302,7 +302,7 @@ public void run2() throws CacheException { } }); - AsyncInvocation asyncInv2 = + AsyncInvocation asyncInv2 = vm0.invokeAsync(new CacheSerializableRunnable("Run query on region") { @Override @@ -393,7 +393,7 @@ public void hook(int spot) throws RuntimeException { } // Asynch invocation for continuous index updates - AsyncInvocation indexUpdateAsysnch = + AsyncInvocation indexUpdateAsysnch = vm0.invokeAsync(new CacheSerializableRunnable("index updates") { @Override diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexOperationsOnOverflowRegionDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexOperationsOnOverflowRegionDUnitTest.java index ff1e154a347b..d36573160fb2 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexOperationsOnOverflowRegionDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexOperationsOnOverflowRegionDUnitTest.java @@ -130,7 +130,7 @@ public void run2() throws CacheException { }); // Start changing the value in Region which should turn into a deadlock if the fix is not there - AsyncInvocation asyncInv1 = + AsyncInvocation asyncInv1 = vm0.invokeAsync(new CacheSerializableRunnable("Change value in region") { @Override @@ -155,7 +155,7 @@ public void run2() throws CacheException { } }); - AsyncInvocation asyncInv2 = + AsyncInvocation asyncInv2 = vm0.invokeAsync(new CacheSerializableRunnable("Run query on region") { @Override @@ -235,7 +235,7 @@ public void run2() throws CacheException { }); // Start changing the value in Region which should turn into a deadlock if the fix is not there - AsyncInvocation asyncInv1 = + AsyncInvocation asyncInv1 = vm0.invokeAsync(new CacheSerializableRunnable("Change value in region") { @Override @@ -260,7 +260,7 @@ public void run2() throws CacheException { } }); - AsyncInvocation asyncInv2 = + AsyncInvocation asyncInv2 = vm0.invokeAsync(new CacheSerializableRunnable("Run query on region") { @Override @@ -341,7 +341,7 @@ public void run2() throws CacheException { // Start changing the value in Region which should turn into a deadlock if // the fix is not there - AsyncInvocation asyncInv1 = + AsyncInvocation asyncInv1 = vm0.invokeAsync(new CacheSerializableRunnable("Change value in region") { @Override @@ -364,7 +364,7 @@ public void run2() throws CacheException { } }); - AsyncInvocation asyncInv2 = + AsyncInvocation asyncInv2 = vm0.invokeAsync(new CacheSerializableRunnable("Run query on region") { @Override @@ -443,7 +443,7 @@ public void run2() throws CacheException { // Start changing the value in Region which should turn into a deadlock if // the fix is not there - AsyncInvocation asyncInv1 = + AsyncInvocation asyncInv1 = vm0.invokeAsync(new CacheSerializableRunnable("Change value in region") { @Override @@ -466,7 +466,7 @@ public void run2() throws CacheException { } }); - AsyncInvocation asyncInv2 = + AsyncInvocation asyncInv2 = vm0.invokeAsync(new CacheSerializableRunnable("Run query on region") { @Override @@ -535,7 +535,7 @@ public void run2() throws CacheException { }); // Start changing the value in Region which should turn into a deadlock if the fix is not there - AsyncInvocation asyncInv1 = + AsyncInvocation asyncInv1 = vm0.invokeAsync(new CacheSerializableRunnable("Change value in region") { @Override @@ -560,7 +560,7 @@ public void run2() throws CacheException { } }); - AsyncInvocation asyncInv2 = + AsyncInvocation asyncInv2 = vm0.invokeAsync(new CacheSerializableRunnable("Run query on region") { @Override @@ -631,7 +631,7 @@ public void run2() throws CacheException { }); // Start changing the value in Region which should turn into a deadlock if the fix is not there - AsyncInvocation asyncInv1 = + AsyncInvocation asyncInv1 = vm0.invokeAsync(new CacheSerializableRunnable("Change value in region") { @Override @@ -654,7 +654,7 @@ public void run2() throws CacheException { } }); - AsyncInvocation asyncInv2 = + AsyncInvocation asyncInv2 = vm0.invokeAsync(new CacheSerializableRunnable("Run query on region") { @Override diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java index f0ac383a57bd..b4380cefb1a4 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexUpdateWithInplaceObjectModFalseDUnitTest.java @@ -169,7 +169,7 @@ public void testCompactRangeIndex() { vm0.invoke(helper.getCacheSerializableRunnableForPRIndexCreate(regionName, indexName, indexedExpression, fromClause, alias)); - AsyncInvocation[] asyncInvs = new AsyncInvocation[2]; + AsyncInvocation[] asyncInvs = new AsyncInvocation[2]; asyncInvs[0] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize)); @@ -177,11 +177,11 @@ public void testCompactRangeIndex() { asyncInvs[1] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize)); - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { ThreadUtils.join(inv, 30 * 000); } - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { if (inv.exceptionOccurred()) { Assert.fail("Random region operation failed on VM_" + inv.getId(), inv.getException()); } @@ -217,7 +217,7 @@ public void testRangeIndex() { vm0.invoke(helper.getCacheSerializableRunnableForPRIndexCreate(regionName, rindexName, rindexedExpression, rfromClause, ralias)); - AsyncInvocation[] asyncInvs = new AsyncInvocation[2]; + AsyncInvocation[] asyncInvs = new AsyncInvocation[2]; asyncInvs[0] = vm0.invokeAsync( helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, totalDataSize)); @@ -225,10 +225,10 @@ public void testRangeIndex() { asyncInvs[1] = vm0.invokeAsync( helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, totalDataSize)); - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { ThreadUtils.join(inv, 30 * 000); } - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { if (inv.exceptionOccurred()) { Assert.fail("Random region operation failed on VM_" + inv.getId(), inv.getException()); } @@ -263,7 +263,7 @@ public void testCompactRangeIndexOnPR() { indexedExpression, fromClause, alias)); - AsyncInvocation[] asyncInvs = new AsyncInvocation[12]; + AsyncInvocation[] asyncInvs = new AsyncInvocation[12]; asyncInvs[0] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize)); @@ -301,11 +301,11 @@ public void testCompactRangeIndexOnPR() { asyncInvs[11] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, (3 * (stepSize)), totalDataSize)); - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { ThreadUtils.join(inv, 60 * 000); } - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { if (inv.exceptionOccurred()) { Assert.fail("Random region operation failed on VM_" + inv.getId(), inv.getException()); } @@ -344,7 +344,7 @@ public void testRangeIndexOnPR() { rindexedExpression, rfromClause, ralias)); - AsyncInvocation[] asyncInvs = new AsyncInvocation[12]; + AsyncInvocation[] asyncInvs = new AsyncInvocation[12]; asyncInvs[0] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize)); @@ -382,10 +382,10 @@ public void testRangeIndexOnPR() { asyncInvs[11] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, (3 * (stepSize)), totalDataSize)); - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { ThreadUtils.join(inv, 60 * 000); } - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { if (inv.exceptionOccurred()) { Assert.fail("Random region operation failed on VM_" + inv.getId(), inv.getException()); } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java index 6be1676e529c..1d2690b02c8a 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/ConcurrentIndexUpdateWithoutWLDUnitTest.java @@ -144,7 +144,7 @@ public void testCompactRangeIndex() { vm0.invoke(helper.getCacheSerializableRunnableForPRIndexCreate(regionName, indexName, indexedExpression, fromClause, alias)); - AsyncInvocation[] asyncInvs = new AsyncInvocation[2]; + AsyncInvocation[] asyncInvs = new AsyncInvocation[2]; asyncInvs[0] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize)); @@ -152,11 +152,11 @@ public void testCompactRangeIndex() { asyncInvs[1] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize)); - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { ThreadUtils.join(inv, 30 * 000); } - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { if (inv.exceptionOccurred()) { Assert.fail("Random region operation failed on VM_" + inv.getId(), inv.getException()); } @@ -189,7 +189,7 @@ public void testMultiIndexCreation() { vm0.invoke( helper.getCacheSerializableRunnableForDefineIndex(regionName, names, exps, fromClauses)); - AsyncInvocation[] asyncInvs = new AsyncInvocation[2]; + AsyncInvocation[] asyncInvs = new AsyncInvocation[2]; asyncInvs[0] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize)); @@ -197,11 +197,11 @@ public void testMultiIndexCreation() { asyncInvs[1] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize)); - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { ThreadUtils.join(inv, 30 * 000); } - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { if (inv.exceptionOccurred()) { Assert.fail("Random region operation failed on VM_" + inv.getId(), inv.getException()); } @@ -236,7 +236,7 @@ public void testRangeIndex() { vm0.invoke(helper.getCacheSerializableRunnableForPRIndexCreate(regionName, rindexName, rindexedExpression, rfromClause, ralias)); - AsyncInvocation[] asyncInvs = new AsyncInvocation[2]; + AsyncInvocation[] asyncInvs = new AsyncInvocation[2]; asyncInvs[0] = vm0.invokeAsync( helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, totalDataSize)); @@ -244,10 +244,10 @@ public void testRangeIndex() { asyncInvs[1] = vm0.invokeAsync( helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, totalDataSize)); - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { ThreadUtils.join(inv, 30 * 000); } - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { if (inv.exceptionOccurred()) { Assert.fail("Random region operation failed on VM_" + inv.getId(), inv.getException()); } @@ -282,7 +282,7 @@ public void testCompactRangeIndexOnPR() { indexedExpression, fromClause, alias)); - AsyncInvocation[] asyncInvs = new AsyncInvocation[12]; + AsyncInvocation[] asyncInvs = new AsyncInvocation[12]; asyncInvs[0] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize)); @@ -320,11 +320,11 @@ public void testCompactRangeIndexOnPR() { asyncInvs[11] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, (3 * (stepSize)), totalDataSize)); - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { ThreadUtils.join(inv, 60 * 000); } - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { if (inv.exceptionOccurred()) { Assert.fail("Random region operation failed on VM_" + inv.getId(), inv.getException()); } @@ -362,7 +362,7 @@ public void testRangeIndexOnPR() { rindexedExpression, rfromClause, ralias)); - AsyncInvocation[] asyncInvs = new AsyncInvocation[12]; + AsyncInvocation[] asyncInvs = new AsyncInvocation[12]; asyncInvs[0] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize)); @@ -400,10 +400,10 @@ public void testRangeIndexOnPR() { asyncInvs[11] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, (3 * (stepSize)), totalDataSize)); - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { ThreadUtils.join(inv, 60 * 000); } - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { if (inv.exceptionOccurred()) { Assert.fail("Random region operation failed on VM_" + inv.getId(), inv.getException()); } @@ -452,7 +452,7 @@ public void testMultiIndexOnPR() { vm0.invoke( helper.getCacheSerializableRunnableForDefineIndex(regionName, names, exps, fromClauses)); - AsyncInvocation[] asyncInvs = new AsyncInvocation[12]; + AsyncInvocation[] asyncInvs = new AsyncInvocation[12]; asyncInvs[0] = vm0.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, 0, stepSize)); @@ -490,11 +490,11 @@ public void testMultiIndexOnPR() { asyncInvs[11] = vm3.invokeAsync(helper.getCacheSerializableRunnableForPRRandomOps(regionName, (3 * (stepSize)), totalDataSize)); - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { ThreadUtils.join(inv, 60 * 000); } - for (AsyncInvocation inv : asyncInvs) { + for (AsyncInvocation inv : asyncInvs) { if (inv.exceptionOccurred()) { Assert.fail("Random region operation failed on VM_" + inv.getId(), inv.getException()); } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/IndexTrackingQueryObserverDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/IndexTrackingQueryObserverDUnitTest.java index 9e63db628ad7..f2b8f35f6246 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/IndexTrackingQueryObserverDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/IndexTrackingQueryObserverDUnitTest.java @@ -95,8 +95,8 @@ public void run() { initializeRegion(ds0); // Check query verbose on both VMs - AsyncInvocation async1 = verifyQueryVerboseData(ds0, TOTAL_OBJECTS / 2); - AsyncInvocation async2 = verifyQueryVerboseData(ds1, TOTAL_OBJECTS / 2); + AsyncInvocation async1 = verifyQueryVerboseData(ds0, TOTAL_OBJECTS / 2); + AsyncInvocation async2 = verifyQueryVerboseData(ds1, TOTAL_OBJECTS / 2); // Run query on one vm only. runQuery(ds1); @@ -243,7 +243,7 @@ public void run() { vm.invoke(runQuery); } - private AsyncInvocation verifyQueryVerboseData(VM vm, final int results) { + private AsyncInvocation verifyQueryVerboseData(VM vm, final int results) { SerializableRunnable testQueryVerbose = new SerializableRunnable("Test Query Verbose Data") { @@ -287,7 +287,7 @@ public String description() { assertEquals(results, totalResults); } }; - AsyncInvocation asyncInv = vm.invokeAsync(testQueryVerbose); + AsyncInvocation asyncInv = vm.invokeAsync(testQueryVerbose); return asyncInv; } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/InitializeIndexEntryDestroyQueryDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/InitializeIndexEntryDestroyQueryDUnitTest.java index 393e71306724..233093d0a2a2 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/InitializeIndexEntryDestroyQueryDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/InitializeIndexEntryDestroyQueryDUnitTest.java @@ -107,9 +107,9 @@ public void testAsyncIndexInitDuringEntryDestroyAndQueryOnPR(Scope scope) { final PortfolioData[] portfolio = createPortfolioData(cnt, cntDest); vm0.invoke( PRQHelp.getCacheSerializableRunnableForPRPuts(regionName, portfolio, cnt, cntDest)); - AsyncInvocation asyInvk0 = + AsyncInvocation asyInvk0 = vm0.invokeAsync(() -> consecutivelyCreateAndDestroyIndex(regionName)); - AsyncInvocation asyInvk1 = + AsyncInvocation asyInvk1 = vm0.invokeAsync(() -> consecutivelyPutAndDestroyEntries(regionName)); vm0.invoke(() -> executeAndValidateQueryResults(query)); waitForAsyncThreadsToComplete(asyInvk0, asyInvk1); @@ -141,7 +141,8 @@ public void testConcurrentRemoveIndexAndQueryOnPR() { } - private void waitForAsyncThreadsToComplete(AsyncInvocation asyInvk0, AsyncInvocation asyInvk1) { + private void waitForAsyncThreadsToComplete(AsyncInvocation asyInvk0, + AsyncInvocation asyInvk1) { ThreadUtils.join(asyInvk0, 1000 * 1000); // TODO: this is way too long: 16.67 minutes! if (asyInvk0.exceptionOccurred()) { logger.error("Asynchronous thread to create and destroy index failed", diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/MultiIndexCreationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/MultiIndexCreationDUnitTest.java index af7e1978e0d1..fc55a359186d 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/MultiIndexCreationDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/MultiIndexCreationDUnitTest.java @@ -67,7 +67,7 @@ public void testConcurrentMultiIndexCreationAndQuery() throws Exception { final String name = SEPARATOR + regionName; // Start server1 - AsyncInvocation a1 = server1.invokeAsync(new SerializableCallable("Create Server1") { + AsyncInvocation a1 = server1.invokeAsync(new SerializableCallable("Create Server1") { @Override public Object call() throws Exception { Region r = getCache().createRegionFactory(RegionShortcut.REPLICATE).create(regionName); @@ -93,7 +93,7 @@ public Object call() throws Exception { final String[] queries = {"select * from " + name + " where status = 'active'", "select * from " + name + " where ID > 4"}; - AsyncInvocation a2 = server1.invokeAsync(new SerializableCallable("Create Server1") { + AsyncInvocation a2 = server1.invokeAsync(new SerializableCallable("Create Server1") { @Override public Object call() throws Exception { long giveupTime = System.currentTimeMillis() + 60000; diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRBasicIndexCreationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRBasicIndexCreationDUnitTest.java index 0ce6f9a0d433..748f6f8f7666 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRBasicIndexCreationDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRBasicIndexCreationDUnitTest.java @@ -251,9 +251,9 @@ public void testCreatePartitionedIndexThroughXML() throws Exception { String fileName = "PRIndexCreation.xml"; setCacheInVMsUsingXML(fileName, vm0, vm1); - AsyncInvocation async0 = vm0.invokeAsync( + AsyncInvocation async0 = vm0.invokeAsync( prQueryDUnitHelper.getCacheSerializableRunnableForPRCreate(PARTITIONED_REGION_NAME)); - AsyncInvocation async1 = vm1.invokeAsync( + AsyncInvocation async1 = vm1.invokeAsync( prQueryDUnitHelper.getCacheSerializableRunnableForPRCreate(PARTITIONED_REGION_NAME)); async0.await(); @@ -458,10 +458,10 @@ public void testPartitionedIndexCreationDuringPersistentRecovery() throws Except vm0.invoke(prQueryDUnitHelper.getCacheSerializableRunnableForCloseCache()); setCacheInVMs(vm0); - AsyncInvocation regionCreateFuture = + AsyncInvocation regionCreateFuture = vm0.invokeAsync(prQueryDUnitHelper.getCacheSerializableRunnableForPersistentPRCreate( PARTITIONED_REGION_NAME, redundancy, PortfolioData.class)); - AsyncInvocation indexCreateFuture = + AsyncInvocation indexCreateFuture = vm1.invokeAsync(prQueryDUnitHelper.getCacheSerializableRunnableForPRIndexCreate( PARTITIONED_REGION_NAME, "PrIndexOnId", "p.ID", null, "p")); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRBasicMultiIndexCreationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRBasicMultiIndexCreationDUnitTest.java index 5e1c2a946007..0bafe93cdf45 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRBasicMultiIndexCreationDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRBasicMultiIndexCreationDUnitTest.java @@ -401,7 +401,7 @@ public void testPartitionedIndexCreationDuringPersistentRecovery() throws Except vm0.invoke(PRQHelp.getCacheSerializableRunnableForCloseCache()); setCacheInVMs(vm0); - AsyncInvocation regionCreateFuture = vm0.invokeAsync(PRQHelp + AsyncInvocation regionCreateFuture = vm0.invokeAsync(PRQHelp .getCacheSerializableRunnableForPersistentPRCreate(name, redundancy, PortfolioData.class)); ArrayList names = new ArrayList<>(); @@ -410,7 +410,7 @@ public void testPartitionedIndexCreationDuringPersistentRecovery() throws Except ArrayList exps = new ArrayList<>(); exps.add("ID"); - AsyncInvocation indexCreateFuture = + AsyncInvocation indexCreateFuture = vm1.invokeAsync(PRQHelp.getCacheSerializableRunnableForDefineIndex(name, names, exps)); regionCreateFuture.await(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRBasicQueryDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRBasicQueryDUnitTest.java index d01e612254f3..0ef553361768 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRBasicQueryDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRBasicQueryDUnitTest.java @@ -191,10 +191,10 @@ public void testColocatedPRQueryDuringRecovery() throws Exception { redundancy, PortfolioData.class, true)); // Now start the child regions asynchronously so queries will happen during persistent recovery - AsyncInvocation async0 = + AsyncInvocation async0 = vm0.invokeAsync(prQueryDUnitHelper.getCacheSerializableRunnableForColocatedChildCreate(name, redundancy, PortfolioData.class, true)); - AsyncInvocation async1 = + AsyncInvocation async1 = vm1.invokeAsync(prQueryDUnitHelper.getCacheSerializableRunnableForColocatedChildCreate(name, redundancy, PortfolioData.class, true)); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryRegionCloseDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryRegionCloseDUnitTest.java index 73474da1c70a..612b0eac276b 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryRegionCloseDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryRegionCloseDUnitTest.java @@ -119,7 +119,7 @@ public void testPRWithRegionCloseInOneDatastoreWithoutDelay() throws Exception { vm0.invoke(prQueryDUnitHelper.getCacheSerializableRunnableForPRPuts(LOCAL_REGION_NAME, portfolio, START_PORTFOLIO_INDEX, END_PORTFOLIO_INDEX)); - AsyncInvocation async0 = + AsyncInvocation async0 = vm0.invokeAsync(prQueryDUnitHelper.getCacheSerializableRunnableForPRQueryAndCompareResults( PARTITIONED_REGION_NAME, LOCAL_REGION_NAME)); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryRegionDestroyedDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryRegionDestroyedDUnitTest.java index 2edf33f14afb..f6e779d96cd5 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryRegionDestroyedDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache/query/partitioned/PRQueryRegionDestroyedDUnitTest.java @@ -120,7 +120,7 @@ public void testPRWithRegionDestroyInOneDatastoreWithDelay() throws Exception { // Now execute the query. And while query execution in process destroy the region // on one of the node. - AsyncInvocation async0 = + AsyncInvocation async0 = vm0.invokeAsync(prQueryDUnitHelper.getCacheSerializableRunnableForPRQueryAndCompareResults( PARTITIONED_REGION_NAME, LOCAL_REGION_NAME)); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheMapTxnDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheMapTxnDUnitTest.java index efc4f4099881..04d64eafe832 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheMapTxnDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheMapTxnDUnitTest.java @@ -150,17 +150,11 @@ public void testMiscMethods() throws Throwable { VM vm0 = host.getVM(0); VM vm1 = host.getVM(1); vm0.invoke(CacheMapTxnDUnitTest::miscMethodsOwner); - AsyncInvocation o2 = vm0.invokeAsync(CacheMapTxnDUnitTest::miscMethodsNotOwner);// invoke - // in - // same - // vm but - // in - // separate - // thread - AsyncInvocation o3 = vm1.invokeAsync(CacheMapTxnDUnitTest::miscMethodsNotOwner);// invoke - // in - // another - // vm + // invoke in same vm but in separate thread + AsyncInvocation o2 = vm0.invokeAsync(CacheMapTxnDUnitTest::miscMethodsNotOwner); + // invoke in another vm + AsyncInvocation o3 = vm1.invokeAsync(CacheMapTxnDUnitTest::miscMethodsNotOwner); + ThreadUtils.join(o2, 30 * 1000); ThreadUtils.join(o3, 30 * 1000); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClearMultiVmDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClearMultiVmDUnitTest.java index 3e212abcb80d..366d921a78f8 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClearMultiVmDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClearMultiVmDUnitTest.java @@ -216,8 +216,8 @@ public void testClearMultiVM() throws Throwable { vm1.invoke(ClearMultiVmDUnitTest.class, "getMethod", objArr); } - AsyncInvocation as1 = vm0.invokeAsync(ClearMultiVmDUnitTest::firstVM); - AsyncInvocation as2 = vm1.invokeAsync(ClearMultiVmDUnitTest::secondVM); + AsyncInvocation as1 = vm0.invokeAsync(ClearMultiVmDUnitTest::firstVM); + AsyncInvocation as2 = vm1.invokeAsync(ClearMultiVmDUnitTest::secondVM); ThreadUtils.join(as1, 30 * 1000); ThreadUtils.join(as2, 30 * 1000); @@ -324,7 +324,7 @@ public void run() { }); // now do the get initial image in vm1 - AsyncInvocation async1 = vm1.invokeAsync(create); + AsyncInvocation async1 = vm1.invokeAsync(create); // try to time a distributed clear to happen in the middle of gii vm0.invoke(new SerializableRunnable("call clear when gii") { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCCEDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCCEDUnitTest.java index c8d8320453ff..1eb6d34be5c3 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCCEDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ClientServerCCEDUnitTest.java @@ -142,7 +142,7 @@ public void testClientEventsAreNotConflatedByGlobalRegionOnServer() throws Excep final int numIterations = 500; - AsyncInvocation[] asyncInvocations = new AsyncInvocation[clientVMs.length]; + AsyncInvocation[] asyncInvocations = new AsyncInvocation[clientVMs.length]; for (int i = 0; i < clientVMs.length; i++) { final String clientGateName = "client" + i + "Ready"; asyncInvocations[i] = clientVMs[i].invokeAsync("doOps Thread", () -> { @@ -153,7 +153,7 @@ public void testClientEventsAreNotConflatedByGlobalRegionOnServer() throws Excep getBlackboard().signalGate("proceed"); - for (final AsyncInvocation asyncInvocation : asyncInvocations) { + for (final AsyncInvocation asyncInvocation : asyncInvocations) { asyncInvocation.join(); } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedAckRegionCCEDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedAckRegionCCEDUnitTest.java index d191451d7c4c..eaef461a3c62 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedAckRegionCCEDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedAckRegionCCEDUnitTest.java @@ -153,7 +153,7 @@ public void testConcurrentOpWithGII() throws InterruptedException { return CCRegion.getDistributionManager().getDistributionManagerId(); }); - AsyncInvocation partialCreate = + AsyncInvocation partialCreate = vm2.invokeAsync("create region with stall", () -> { final GemFireCacheImpl cache = (GemFireCacheImpl) getCache(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedNoAckRegionCCEDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedNoAckRegionCCEDUnitTest.java index d221f33b7d65..3775f91fa563 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedNoAckRegionCCEDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedNoAckRegionCCEDUnitTest.java @@ -113,12 +113,12 @@ public void testClearWithManyEventsInFlight() { vm0.invoke(DistributedNoAckRegionCCEDUnitTest::addBlockingListener); vm1.invoke(DistributedNoAckRegionCCEDUnitTest::addBlockingListener); vm2.invoke(DistributedNoAckRegionCCEDUnitTest::addBlockingListener); - AsyncInvocation vm0Ops = vm0.invokeAsync(DistributedNoAckRegionCCEDUnitTest::doManyOps); - AsyncInvocation vm1Ops = vm1.invokeAsync(DistributedNoAckRegionCCEDUnitTest::doManyOps); - AsyncInvocation vm2Ops = vm2.invokeAsync(DistributedNoAckRegionCCEDUnitTest::doManyOps); + AsyncInvocation vm0Ops = vm0.invokeAsync(DistributedNoAckRegionCCEDUnitTest::doManyOps); + AsyncInvocation vm1Ops = vm1.invokeAsync(DistributedNoAckRegionCCEDUnitTest::doManyOps); + AsyncInvocation vm2Ops = vm2.invokeAsync(DistributedNoAckRegionCCEDUnitTest::doManyOps); // pause to let a bunch of operations build up Wait.pause(5000); - AsyncInvocation a0 = vm3.invokeAsync(DistributedNoAckRegionCCEDUnitTest::clearRegion); + AsyncInvocation a0 = vm3.invokeAsync(DistributedNoAckRegionCCEDUnitTest::clearRegion); vm0.invoke(DistributedNoAckRegionCCEDUnitTest::unblockListener); vm1.invoke(DistributedNoAckRegionCCEDUnitTest::unblockListener); vm2.invoke(DistributedNoAckRegionCCEDUnitTest::unblockListener); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/GlobalRegionDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/GlobalRegionDUnitTest.java index 925eea0bb710..49ab46067547 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/GlobalRegionDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/GlobalRegionDUnitTest.java @@ -176,7 +176,7 @@ public void testSynchronousIncrements() throws InterruptedException { }); } - AsyncInvocation[] invokes = new AsyncInvocation[vmCount]; + AsyncInvocation[] invokes = new AsyncInvocation[vmCount]; for (int i = 0; i < vmCount; i++) { invokes[i] = VM.getVM(i).invokeAsync("Start Threads and increment", () -> { final ThreadGroup group = new ThreadGroup("Incrementors") { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/PutAllMultiVmDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/PutAllMultiVmDUnitTest.java index 8f6c0479901d..147a1b5a47c2 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/PutAllMultiVmDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/PutAllMultiVmDUnitTest.java @@ -127,13 +127,13 @@ public static void closeCache() { } }// end of closeCache - private AsyncInvocation invokeClear(VM vm) { - AsyncInvocation async = vm.invokeAsync(() -> region.clear()); + private AsyncInvocation invokeClear(VM vm) { + AsyncInvocation async = vm.invokeAsync(() -> region.clear()); return async; } - private AsyncInvocation invokeBulkOp(VM vm) { - AsyncInvocation async = vm.invokeAsync(() -> { + private AsyncInvocation invokeBulkOp(VM vm) { + AsyncInvocation async = vm.invokeAsync(() -> { Map m = new HashMap(); for (int i = 0; i < 20; i++) { m.put(i, "map" + i); @@ -159,8 +159,8 @@ private void testBulkOpFromNonDataStore(final DataPolicy dataPolicy) throws Inte Random rand = new Random(); for (int k = 0; k < 100; k++) { int shuffle = rand.nextInt(2); - AsyncInvocation a1 = null; - AsyncInvocation a2 = null; + AsyncInvocation a1 = null; + AsyncInvocation a2 = null; if (shuffle == 1) { a1 = invokeClear(vm1); a2 = invokeBulkOp(vm2); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectDUnitTest.java index 163ac6a78643..cf441b3b1898 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectDUnitTest.java @@ -776,13 +776,13 @@ public void run2() throws CacheException { getRoleAPlayerForCacheInitializationRunnable(vm0, locPort, regionName, "starting roleAplayer, which will initialize, wait for " + "vm0 to initialize, and then close its cache to cause role loss"); - AsyncInvocation avkVm1 = vm1.invokeAsync(roleAPlayerForCacheInitialization); + AsyncInvocation avkVm1 = vm1.invokeAsync(roleAPlayerForCacheInitialization); CacheSerializableRunnable roleLoss = getRoleLossRunnable(vm1, locPort, regionName, myKey, myValue, "starting role loss vm. When the role is lost it will start" + " trying to reconnect", file.getAbsolutePath()); - final AsyncInvocation roleLossAsync = vm0.invokeAsync(roleLoss); + final AsyncInvocation roleLossAsync = vm0.invokeAsync(roleLoss); System.out.println("waiting for role loss vm to start reconnect attempts"); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java index 8149b1466bc6..a33ec1b0d798 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java @@ -174,15 +174,15 @@ public void testReconnectAfterMeltdown() throws InterruptedException { system = cache.getDistributedSystem(); }); } - AsyncInvocation[] crashers = new AsyncInvocation[NUM_VMS]; + AsyncInvocation[] crashers = new AsyncInvocation[NUM_VMS]; for (int i = 0; i < NUM_VMS; i++) { crashers[i] = VM.getVM(i).invokeAsync("crash", () -> MembershipManagerHelper.crashDistributedSystem(system)); } - for (AsyncInvocation crasher : crashers) { + for (AsyncInvocation crasher : crashers) { crasher.join(); } - AsyncInvocation[] waiters = new AsyncInvocation[NUM_VMS]; + AsyncInvocation[] waiters = new AsyncInvocation[NUM_VMS]; for (int i = NUM_VMS - 1; i >= 0; i--) { waiters[i] = VM.getVM(i).invokeAsync("wait for reconnect", () -> { system.waitUntilReconnected(GeodeAwaitility.getTimeout().toMillis(), @@ -194,7 +194,7 @@ public void testReconnectAfterMeltdown() throws InterruptedException { .isEqualTo(NUM_VMS - 1)); }); } - for (AsyncInvocation waiter : waiters) { + for (AsyncInvocation waiter : waiters) { waiter.join(); } } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/SearchAndLoadDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/SearchAndLoadDUnitTest.java index 4c81f806e1c0..fd1131a204a5 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/SearchAndLoadDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/SearchAndLoadDUnitTest.java @@ -220,7 +220,7 @@ public void close() {} } }); - AsyncInvocation async1 = null; + AsyncInvocation async1 = null; try { async1 = vm0.invokeAsync("Concurrently invoke the remote loader on the same key - t1", new CacheSerializableRunnable() { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java index ff79803c004e..5e6129228925 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/DistributedLockServiceDUnitTest.java @@ -1386,9 +1386,9 @@ public void run() { // get a lock logger.info("[testSuspendLockingBehaves] line up vms for lock"); vmOne.invoke(lockKey); - AsyncInvocation vmTwoLocking = vmTwo.invokeAsync(lockKey); + AsyncInvocation vmTwoLocking = vmTwo.invokeAsync(lockKey); Wait.pause(2000); // make sure vmTwo is first in line - AsyncInvocation vmThreeLocking = vmThree.invokeAsync(lockKey); + AsyncInvocation vmThreeLocking = vmThree.invokeAsync(lockKey); Wait.pause(2000); // make sure vmTwo and vmThree are still waiting for lock on key1 @@ -1404,9 +1404,9 @@ public void run() { // start suspending in vmOne and vmTwo logger.info("[testSuspendLockingBehaves] start suspending requests"); - AsyncInvocation vmOneSuspending = vmOne.invokeAsync(suspendLocking); + AsyncInvocation vmOneSuspending = vmOne.invokeAsync(suspendLocking); Wait.pause(2000); // make sure vmOne is first in line - AsyncInvocation vmTwoSuspending = vmTwo.invokeAsync(suspendLocking); + AsyncInvocation vmTwoSuspending = vmTwo.invokeAsync(suspendLocking); Wait.pause(2000); // let vmThree finish locking key @@ -1416,7 +1416,7 @@ public void run() { // have vmOne get back in line for locking key logger.info("[testSuspendLockingBehaves] start another lock request"); - AsyncInvocation vmOneLockingAgain = vmOne.invokeAsync(lockKey); + AsyncInvocation vmOneLockingAgain = vmOne.invokeAsync(lockKey); Wait.pause(2000); // let vmOne suspend locking @@ -1429,7 +1429,7 @@ public void run() { // start suspending in vmThree logger .info("[testSuspendLockingBehaves] line up vmThree for suspending"); - AsyncInvocation vmThreeSuspending = vmThree.invokeAsync(suspendLocking); + AsyncInvocation vmThreeSuspending = vmThree.invokeAsync(suspendLocking); Wait.pause(2000); // let vmTwo suspend locking @@ -1473,7 +1473,7 @@ public void testSuspendLockingBlocksUntilNoLocks() throws InterruptedException { // Get lock from other VM. Since same thread needs to lock and unlock, // invoke asynchronously, get lock, wait to be notified, then unlock. VM vm1 = getVM(1); - AsyncInvocation asyncInvocation = + AsyncInvocation asyncInvocation = vm1.invokeAsync(new SerializableRunnable("Lock & unlock in vm1") { @Override public void run() { @@ -2575,7 +2575,7 @@ public void run() { } }); - AsyncInvocation whileVM1Locks = null; + AsyncInvocation whileVM1Locks = null; try { // vm1 locks key1 whileVM1Locks = vm1.invokeAsync(new SerializableRunnable() { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/GrantorFailoverDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/GrantorFailoverDUnitTest.java index 6051691a19a0..5f862516c548 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/distributed/GrantorFailoverDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/GrantorFailoverDUnitTest.java @@ -138,10 +138,10 @@ public void lockRecoveryAfterGrantorDies() throws Exception { .invoke(() -> DistributedLockService.getServiceNamed(SERVICE_NAME).lock(lock2, 2, -1))) .isFalse(); - final AsyncInvocation lock1FailsReleaseOnOtherVM = + final AsyncInvocation lock1FailsReleaseOnOtherVM = survivor2 .invokeAsync(() -> DistributedLockService.getServiceNamed(SERVICE_NAME).unlock(lock1)); - final AsyncInvocation lock2FailsReleaseOnOtherVM = + final AsyncInvocation lock2FailsReleaseOnOtherVM = survivor1 .invokeAsync(() -> DistributedLockService.getServiceNamed(SERVICE_NAME).unlock(lock2)); @@ -155,15 +155,15 @@ public void lockRecoveryAfterGrantorDies() throws Exception { .invoke(() -> DistributedLockService.getServiceNamed(SERVICE_NAME).lock(lock3, 20_000, -1))) .isTrue(); - final AsyncInvocation lock1SuccessfulRelease = + final AsyncInvocation lock1SuccessfulRelease = survivor1 .invokeAsync(() -> DistributedLockService.getServiceNamed(SERVICE_NAME).unlock(lock1)); - final AsyncInvocation lock3SuccessfulRelease = + final AsyncInvocation lock3SuccessfulRelease = survivor1 .invokeAsync(() -> DistributedLockService.getServiceNamed(SERVICE_NAME).unlock(lock3)); - final AsyncInvocation lock2SuccessfulRelease = + final AsyncInvocation lock2SuccessfulRelease = survivor2 .invokeAsync(() -> DistributedLockService.getServiceNamed(SERVICE_NAME).unlock(lock2)); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java index b9fe0226d9bf..a749f5c0c157 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/deadlock/GemFireDeadlockDetectorDUnitTest.java @@ -124,10 +124,10 @@ public void testDistributedDeadlockWithFunction() throws Throwable { String gateOnMember2 = "gateOnMember2"; // This thread locks the lock member1 first, then member2. - AsyncInvocation async1 = lockTheLocks(vm0, member2, gateOnMember1, gateOnMember2); + AsyncInvocation async1 = lockTheLocks(vm0, member2, gateOnMember1, gateOnMember2); // This thread locks the lock member2 first, then member1. - AsyncInvocation async2 = lockTheLocks(vm1, member1, gateOnMember2, gateOnMember1); + AsyncInvocation async2 = lockTheLocks(vm1, member1, gateOnMember2, gateOnMember1); try { final LinkedList[] deadlockHolder = new LinkedList[1]; await("waiting for deadlock").until(() -> { @@ -153,7 +153,7 @@ public void testDistributedDeadlockWithFunction() throws Throwable { - private AsyncInvocation lockTheLocks(VM vm0, final InternalDistributedMember member, + private AsyncInvocation lockTheLocks(VM vm0, final InternalDistributedMember member, final String gateToSignal, final String gateToWaitOn) { return vm0.invokeAsync(new SerializableRunnable() { @@ -186,8 +186,8 @@ public void testDistributedDeadlockWithDLock() throws Throwable { TypeRegistry.init(); getSystem(); - AsyncInvocation async1 = lockTheDLocks(vm0, "one", "two"); - AsyncInvocation async2 = lockTheDLocks(vm1, "two", "one"); + AsyncInvocation async1 = lockTheDLocks(vm0, "one", "two"); + AsyncInvocation async2 = lockTheDLocks(vm1, "two", "one"); await("waiting for locks to be acquired") .untilAsserted(() -> assertTrue(getBlackboard().isGateSignaled("one"))); @@ -211,7 +211,7 @@ public void testDistributedDeadlockWithDLock() throws Throwable { } } - private void waitForAsyncInvocation(AsyncInvocation async1, int howLong, TimeUnit units) + private void waitForAsyncInvocation(AsyncInvocation async1, int howLong, TimeUnit units) throws java.util.concurrent.ExecutionException, InterruptedException { try { async1.get(howLong, units); @@ -220,7 +220,7 @@ private void waitForAsyncInvocation(AsyncInvocation async1, int howLong, TimeUni } } - private AsyncInvocation lockTheDLocks(VM vm, final String first, final String second) { + private AsyncInvocation lockTheDLocks(VM vm, final String first, final String second) { return vm.invokeAsync(new SerializableRunnable() { @Override diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerGetAllDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerGetAllDUnitTest.java index 432971fc5414..1da3b12250d6 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerGetAllDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerGetAllDUnitTest.java @@ -276,7 +276,7 @@ public void run2() throws CacheException { // Run getAll { final int THREAD_COUNT = 4; - AsyncInvocation[] ais = new AsyncInvocation[THREAD_COUNT]; + AsyncInvocation[] ais = new AsyncInvocation[THREAD_COUNT]; for (int i = 0; i < THREAD_COUNT; i++) { ais[i] = client.invokeAsync(clientGetAll); } @@ -414,7 +414,7 @@ public void run2() throws CacheException { // Run getAll { final int THREAD_COUNT = 4; - AsyncInvocation[] ais = new AsyncInvocation[THREAD_COUNT]; + AsyncInvocation[] ais = new AsyncInvocation[THREAD_COUNT]; for (int i = 0; i < THREAD_COUNT; i++) { ais[i] = client.invokeAsync(clientGetAll); } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverDistributedTest.java index 393acb69652e..a5095a0312aa 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ClientServerTransactionFailoverDistributedTest.java @@ -424,7 +424,7 @@ public void beforeProcessMessage(ClusterDistributionManager dm, }); }); - AsyncInvocation clientAsync = client.invokeAsync(() -> { + AsyncInvocation clientAsync = client.invokeAsync(() -> { { CacheTransactionManager transactionManager = clientCacheRule.getClientCache().getCacheTransactionManager(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ConcurrentDestroySubRegionDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ConcurrentDestroySubRegionDUnitTest.java index 9ea1092d90ac..4cb5c3cf6baa 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ConcurrentDestroySubRegionDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ConcurrentDestroySubRegionDUnitTest.java @@ -97,7 +97,7 @@ public void run() { } }; - AsyncInvocation future = vm0.invokeAsync(destroyParent); + AsyncInvocation future = vm0.invokeAsync(destroyParent); try { vm1.invoke(createChild); } catch (Exception e) { @@ -160,7 +160,7 @@ public void run() { } }; - AsyncInvocation future = vm0.invokeAsync(destroyParent); + AsyncInvocation future = vm0.invokeAsync(destroyParent); try { vm1.invoke(createChild); } catch (Exception e) { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ConnectDisconnectDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ConnectDisconnectDUnitTest.java index 1e27f8f8d6ca..096ecef0a5c3 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ConnectDisconnectDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ConnectDisconnectDUnitTest.java @@ -96,7 +96,7 @@ public void testManyConnectsAndDisconnects() throws Exception { vms[i] = Host.getHost(0).getVM(i); } - AsyncInvocation[] asyncs = new AsyncInvocation[numVMs]; + AsyncInvocation[] asyncs = new AsyncInvocation[numVMs]; for (int i = 0; i < numVMs; i++) { asyncs[i] = vms[i].invokeAsync(new SerializableRunnable("Create a cache") { @Override diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DestroyRegionDuringGIIDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DestroyRegionDuringGIIDistributedTest.java index e04dcd2ae225..7e27a924d90c 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DestroyRegionDuringGIIDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DestroyRegionDuringGIIDistributedTest.java @@ -239,7 +239,7 @@ public void testNBRegionDestructionDuringGetInitialImage(CacheDefinition cacheDe }); // start asynchronous process that does updates to the data - AsyncInvocation updateDataInVM0 = vm0.invokeAsync(() -> { + AsyncInvocation updateDataInVM0 = vm0.invokeAsync(() -> { await().until(() -> getCache().getCachePerfStats().getGetInitialImagesCompleted() < 1); Region region = getCache().getRegion(regionName); @@ -259,7 +259,7 @@ public void testNBRegionDestructionDuringGetInitialImage(CacheDefinition cacheDe addIgnoredException(RegionDestroyedException.class); // in the meantime, do the get initial image in vm2 - AsyncInvocation getInitialImageInVM2 = vm2.invokeAsync(() -> { + AsyncInvocation getInitialImageInVM2 = vm2.invokeAsync(() -> { if (!regionDefinition.getScope().isGlobal()) { InitialImageOperation.slowImageProcessing = 200; } @@ -341,7 +341,7 @@ public void testNBRegionInvalidationDuringGetInitialImage(CacheDefinition cacheD }); // start asynchronous process that does updates to the data - AsyncInvocation updateDataInVM0 = vm0.invokeAsync("Do Nonblocking Operations", () -> { + AsyncInvocation updateDataInVM0 = vm0.invokeAsync("Do Nonblocking Operations", () -> { Region region = getCache().getRegion(regionName); // wait for profile of getInitialImage cache to show up @@ -364,7 +364,7 @@ public void testNBRegionInvalidationDuringGetInitialImage(CacheDefinition cacheD }); } - AsyncInvocation getInitialImageInVM2 = vm2.invokeAsync("Create Mirrored Region", () -> { + AsyncInvocation getInitialImageInVM2 = vm2.invokeAsync("Create Mirrored Region", () -> { cacheXmlRule.beginCacheXml(); // root region must be DACK because its used to sync up async subregions 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 20e247b7181a..92bdb882984f 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 @@ -202,8 +202,8 @@ private void createConflictOperationsP2R3() { P.invoke(() -> GIIDeltaDUnitTest.slowGII(blocklist)); R.invoke(() -> GIIDeltaDUnitTest.slowGII(blocklist)); - AsyncInvocation async1 = doOnePutAsync(P, 2, "key1"); - AsyncInvocation async2 = doOnePutAsync(R, 3, "key1"); + AsyncInvocation async1 = doOnePutAsync(P, 2, "key1"); + AsyncInvocation async2 = doOnePutAsync(R, 3, "key1"); // wait for the local puts are done at P & R before distribution waitForToVerifyRVV(P, memberP, 2, null, 0); // P's rvv=p2, gc=0 @@ -237,10 +237,10 @@ private void createUnfinishedOperationsR4R5() { // let r6 to succeed, r4,r5 to be blocked R.invoke(() -> GIIDeltaDUnitTest.slowGII(exceptionlist)); - AsyncInvocation async1 = doOnePutAsync(R, 4, "key4"); + AsyncInvocation async1 = doOnePutAsync(R, 4, "key4"); waitForToVerifyRVV(R, memberR, 4, null, 0); // P's rvv=r4, gc=0 - AsyncInvocation async2 = doOneDestroyAsync(R, 5, "key5"); + AsyncInvocation async2 = doOneDestroyAsync(R, 5, "key5"); waitForToVerifyRVV(R, memberR, 5, null, 0); // P's rvv=r5, gc=0 doOnePut(R, 6, "key1"); // r6 will pass @@ -480,7 +480,7 @@ public void run() { // restart and gii checkIfFullGII(P, REGION_NAME, R_rvv_bytes, false); - AsyncInvocation async3 = createDistributedRegionAsync(R); + AsyncInvocation async3 = createDistributedRegionAsync(R); // 2 waitForCallbackStarted(R, GIITestHookType.AfterRequestRVV); @@ -603,7 +603,7 @@ public void run() { }); // restart R and gii, it will be blocked at test hook - AsyncInvocation async3 = createDistributedRegionAsync(R); + AsyncInvocation async3 = createDistributedRegionAsync(R); // 7 waitForCallbackStarted(P, GIITestHookType.AfterReceivedRequestImage); @@ -779,7 +779,7 @@ public void testFullGIINotDorminatedByProviderRVVGC() throws Throwable { final long[] exceptionlist2 = {8}; // let p9 to succeed, p8 to be blocked P.invoke(() -> GIIDeltaDUnitTest.slowGII(exceptionlist2)); - AsyncInvocation async1 = doOneDestroyAsync(P, 8, "key1"); + AsyncInvocation async1 = doOneDestroyAsync(P, 8, "key1"); waitForToVerifyRVV(P, memberP, 8, null, 0); doOnePut(P, 9, "key3"); waitForToVerifyRVV(P, memberP, 9, null, 0); @@ -823,10 +823,10 @@ public void testUnfinishedOpsWithoutExceptionList() throws Throwable { final long[] exceptionlist = {4, 5}; R.invoke(() -> GIIDeltaDUnitTest.slowGII(exceptionlist)); - AsyncInvocation async1 = doOnePutAsync(R, 4, "key4"); + AsyncInvocation async1 = doOnePutAsync(R, 4, "key4"); waitForToVerifyRVV(R, memberR, 4, null, 0); // P's rvv=r4, gc=0 - AsyncInvocation async2 = doOneDestroyAsync(R, 5, "key5"); + AsyncInvocation async2 = doOneDestroyAsync(R, 5, "key5"); waitForToVerifyRVV(R, memberR, 5, null, 0); // P's rvv=r5, gc=0 // P should have unfinished ops R4,R5, but they did not show up in exception list @@ -986,7 +986,7 @@ public void run() { closeCache(R); changeForceFullGII(R, true, false); - AsyncInvocation async3 = createDistributedRegionAsync(R); + AsyncInvocation async3 = createDistributedRegionAsync(R); waitForCallbackStarted(R, GIITestHookType.BeforeSavedReceivedRVV); doOnePut(P, 4, "key1"); @@ -1055,7 +1055,7 @@ public void run() { }); closeCache(R); - AsyncInvocation async3 = createDistributedRegionAsync(R); + AsyncInvocation async3 = createDistributedRegionAsync(R); waitForCallbackStarted(R, GIITestHookType.AfterCalculatedUnfinishedOps); doOnePut(P, 4, "key1"); @@ -1099,10 +1099,10 @@ public void testHooks() throws Throwable { final long[] exceptionlist = {4, 5}; R.invoke(() -> GIIDeltaDUnitTest.slowGII(exceptionlist)); - AsyncInvocation async1 = doOnePutAsync(R, 4, "key4"); + AsyncInvocation async1 = doOnePutAsync(R, 4, "key4"); waitForToVerifyRVV(R, memberR, 4, null, 0); // P's rvv=r4, gc=0 - AsyncInvocation async2 = doOneDestroyAsync(R, 5, "key5"); + AsyncInvocation async2 = doOneDestroyAsync(R, 5, "key5"); waitForToVerifyRVV(R, memberR, 5, null, 0); // P's rvv=r5, gc=0 // P should have unfinished ops R4,R5, but they did not show up in exception list @@ -1253,7 +1253,7 @@ public void run() { waitForToVerifyRVV(P, memberR, 3, null, 0); // P's rvv=r3, gc=0 // now P's rvv=P7,R3, R's RVV=P6,R5 checkIfFullGII(P, REGION_NAME, R_rvv_bytes, false); - AsyncInvocation async3 = createDistributedRegionAsync(R); + AsyncInvocation async3 = createDistributedRegionAsync(R); // 1 waitForCallbackStarted(R, GIITestHookType.BeforeRequestRVV); @@ -1386,9 +1386,9 @@ public void run() { checkIfFullGII(P, REGION_NAME, R_rvv_bytes, false); // restart R and gii, it will be blocked at test hook - AsyncInvocation async3 = createDistributedRegionAsync(R); + AsyncInvocation async3 = createDistributedRegionAsync(R); // restart R and gii, it will be blocked at test hook - AsyncInvocation async4 = createDistributedRegionAsync(T); + AsyncInvocation async4 = createDistributedRegionAsync(T); // 8 waitForCallbackStarted(P, DuringPackingImage); WaitCriterion ev = new WaitCriterion() { @@ -1530,7 +1530,7 @@ public void run() { checkIfFullGII(P, REGION_NAME, R_rvv_bytes, false); // restart R and gii, it will be blocked at test hook - AsyncInvocation async3 = createDistributedRegionAsync(R); + AsyncInvocation async3 = createDistributedRegionAsync(R); // 8 waitForCallbackStarted(P, DuringPackingImage); WaitCriterion ev = new WaitCriterion() { @@ -1632,7 +1632,7 @@ public void run() { checkIfFullGII(P, REGION_NAME, R_rvv_bytes, false); // restart R and gii, it will be blocked at test hook - AsyncInvocation async3 = createDistributedRegionAsync(R); + AsyncInvocation async3 = createDistributedRegionAsync(R); // 8 waitForCallbackStarted(P, GIITestHookType.AfterReceivedRequestImage); int count = getDeltaGIICount(P); @@ -1831,7 +1831,7 @@ public void run() { // retart R checkIfFullGII(P, REGION_NAME, R_rvv_bytes, false); - AsyncInvocation async3 = createDistributedRegionAsync(R); + AsyncInvocation async3 = createDistributedRegionAsync(R); // when chunk arrived, do clear() waitForCallbackStarted(R, GIITestHookType.AfterReceivedImageReply); @@ -1902,7 +1902,7 @@ public void run() { doOnePut(P, 7, "key1"); // retart R - AsyncInvocation async3 = createDistributedRegionAsync(R); + AsyncInvocation async3 = createDistributedRegionAsync(R); // when chunk arrived, do clear() waitForCallbackStarted(R, GIITestHookType.AfterSavedReceivedRVV); @@ -2055,7 +2055,7 @@ public void run() { doOnePut(P, 7, "key1"); // retart R - AsyncInvocation async3 = createDistributedRegionAsync(R); + AsyncInvocation async3 = createDistributedRegionAsync(R); // when chunk arrived, do clear() waitForCallbackStarted(R, GIITestHookType.AfterSavedReceivedRVV); @@ -2125,7 +2125,7 @@ public void run() { // retart R - AsyncInvocation async3 = createDistributedRegionAsync(R); + AsyncInvocation async3 = createDistributedRegionAsync(R); // when chunk arrived, do clear() waitForCallbackStarted(R, GIITestHookType.BeforeSavedReceivedRVV); @@ -2214,7 +2214,7 @@ public void beforeSendMessage(ClusterDistributionManager dm, && ((TombstoneMessage) message).regionPath.contains(REGION_NAME)) { System.err.println("DAN DEBUG about to send tombstone message, starting up R - " + message.getSender()); - AsyncInvocation async3 = createDistributedRegionAsync(vmR); + AsyncInvocation async3 = createDistributedRegionAsync(vmR); // Wait for R to finish requesting the RVV before letting the tombstone GC proceeed. waitForCallbackStarted(vmR, GIITestHookType.AfterCalculatedUnfinishedOps); @@ -2284,7 +2284,7 @@ protected RegionAttributes getRegionAttributes() { } protected void createDistributedRegion(VM vm) { - AsyncInvocation future = createDistributedRegionAsync(vm); + AsyncInvocation future = createDistributedRegionAsync(vm); try { future.join(MAX_WAIT); } catch (InterruptedException e) { @@ -2298,7 +2298,7 @@ protected void createDistributedRegion(VM vm) { } } - protected AsyncInvocation createDistributedRegionAsync(VM vm) { + protected AsyncInvocation createDistributedRegionAsync(VM vm) { SerializableRunnable createRegion = new SerializableRunnable("Create Region") { @Override public void run() { @@ -2753,11 +2753,11 @@ private void doOnePut(final VM vm, final long regionVersionForThisOp, final Stri vm.invoke(putOp); } - private AsyncInvocation doOnePutAsync(final VM vm, final long regionVersionForThisOp, + private AsyncInvocation doOnePutAsync(final VM vm, final long regionVersionForThisOp, final String key) { SerializableRunnable putOp = onePutOp(key, generateValue(vm), regionVersionForThisOp, getMemberID(vm), false); - AsyncInvocation async = vm.invokeAsync(putOp); + AsyncInvocation async = vm.invokeAsync(putOp); return async; } @@ -2787,11 +2787,11 @@ private void doOneDestroy(final VM vm, final long regionVersionForThisOp, final vm.invoke(destroyOp); } - private AsyncInvocation doOneDestroyAsync(final VM vm, final long regionVersionForThisOp, + private AsyncInvocation doOneDestroyAsync(final VM vm, final long regionVersionForThisOp, final String key) { SerializableRunnable destroyOp = oneDestroyOp(key, generateValue(vm), regionVersionForThisOp, getMemberID(vm), false); - AsyncInvocation async = vm.invokeAsync(destroyOp); + AsyncInvocation async = vm.invokeAsync(destroyOp); return async; } @@ -2869,7 +2869,7 @@ public Object call() throws Exception { return result; } - private void checkAsyncCall(AsyncInvocation async) { + private void checkAsyncCall(AsyncInvocation async) { try { async.join(30000); if (async.exceptionOccurred()) { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/GIIFlowControlDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/GIIFlowControlDUnitTest.java index 15f4ed262924..8ac99a73ecd5 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/GIIFlowControlDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/GIIFlowControlDUnitTest.java @@ -122,7 +122,7 @@ public void run() { createData(vm0, 0, 50, "1234567890"); - AsyncInvocation async1 = createRegionAsync(vm1); + AsyncInvocation async1 = createRegionAsync(vm1); async1.join(100); assertTrue(async1.isAlive()); @@ -199,7 +199,7 @@ public void run() { createData(vm0, 0, 50, "1234567890"); - AsyncInvocation async1 = createRegionAsync(vm1); + AsyncInvocation async1 = createRegionAsync(vm1); vm1.invoke(new SerializableRunnable("Wait to flow control messages") { @@ -427,7 +427,7 @@ public void run() { return createRegion; } - private AsyncInvocation createRegionAsync(VM vm) throws Throwable { + private AsyncInvocation createRegionAsync(VM vm) throws Throwable { SerializableRunnable createRegion = getCreateRegionRunnable(); return vm.invokeAsync(createRegion); } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/InterruptClientServerDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/InterruptClientServerDUnitTest.java index f13cac549e1c..7cf7b7a95759 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/InterruptClientServerDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/InterruptClientServerDUnitTest.java @@ -142,7 +142,7 @@ public Object call() throws Exception { } }; - AsyncInvocation async0 = vm2.invokeAsync(doPuts); + AsyncInvocation async0 = vm2.invokeAsync(doPuts); vm1.invoke(new SerializableCallable() { @Override diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/InterruptsDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/InterruptsDUnitTest.java index 23bf8a5b8932..b9f3c9735892 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/InterruptsDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/InterruptsDUnitTest.java @@ -131,7 +131,7 @@ public Object call() throws Exception { } }; - AsyncInvocation async0 = vm0.invokeAsync(doPuts); + AsyncInvocation async0 = vm0.invokeAsync(doPuts); vm1.invoke(new SerializableCallable() { @Override diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PREntryIdleExpirationDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PREntryIdleExpirationDistributedTest.java index 236516019d87..e2bc90752d4b 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PREntryIdleExpirationDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PREntryIdleExpirationDistributedTest.java @@ -106,7 +106,7 @@ private void waitForExpirationInEachMember() { @Test public void readsInOtherMemberShouldPreventExpiration() throws Exception { - AsyncInvocation memberReading = member3.invokeAsync(() -> { + AsyncInvocation memberReading = member3.invokeAsync(() -> { Region region = cacheRule.getCache().getRegion(regionName); region.put(KEY, VALUE); ExpiryTask.permitExpiration(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PREntrySetIteratorRegressionTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PREntrySetIteratorRegressionTest.java index 1a7f0f69857b..5f1e566fa7ee 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PREntrySetIteratorRegressionTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PREntrySetIteratorRegressionTest.java @@ -65,14 +65,14 @@ public void setUp() throws Exception { @Test public void regionEntrySetIteratorNextShouldNeverReturnNull() throws Exception { - AsyncInvocation destroySomeEntries = vm1.invokeAsync(() -> { + AsyncInvocation destroySomeEntries = vm1.invokeAsync(() -> { Region region = getCache().getRegion(uniqueName); for (int j = 0; j < ENTRY_COUNT / ENTRY_DESTROY_SEQUENCE; j += ENTRY_DESTROY_SEQUENCE) { region.destroy(j); } }); - AsyncInvocation validateEntrySetIteratorContainsNoNulls = vm2.invokeAsync(() -> { + AsyncInvocation validateEntrySetIteratorContainsNoNulls = vm2.invokeAsync(() -> { Region region = getCache().getRegion(uniqueName); for (Entry entry : region.entrySet()) { assertThat(entry).isNotNull(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java index f29af2bb54e7..a1e30c81afb0 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionBucketCreationDistributionDUnitTest.java @@ -61,7 +61,7 @@ public class PartitionedRegionBucketCreationDistributionDUnitTest extends CacheT private VM vm2; private VM vm3; - private transient List asyncInvocations; + private transient List> asyncInvocations; @Before public void setUp() { @@ -670,7 +670,7 @@ private void invokeAsync(final VM vm, final SerializableRunnableIF runnable) { } private void awaitAllAsyncInvocations() throws ExecutionException, InterruptedException { - for (AsyncInvocation async : asyncInvocations) { + for (AsyncInvocation async : asyncInvocations) { async.await(); } } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionCreationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionCreationDUnitTest.java index f26e25b3e935..f6361529a67a 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionCreationDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionCreationDUnitTest.java @@ -62,7 +62,7 @@ public class PartitionedRegionCreationDUnitTest extends CacheTestCase { private int numberOfRegions; private String prNamePrefix; - private transient List asyncInvocations; + private transient List> asyncInvocations; @Rule public ExecutorServiceRule executorServiceRule = new ExecutorServiceRule(); @@ -419,7 +419,7 @@ private void invokeAsync(final VM vm, final SerializableRunnableIF runnable) { } private void awaitAllAsyncInvocations() throws ExecutionException, InterruptedException { - for (AsyncInvocation async : asyncInvocations) { + for (AsyncInvocation async : asyncInvocations) { async.await(); } asyncInvocations.clear(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionDestroyDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionDestroyDUnitTest.java index 09657ee899e6..4f85e79a9a16 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionDestroyDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionDestroyDUnitTest.java @@ -97,7 +97,7 @@ public void testDestroyRegion() throws Exception { } }); - AsyncInvocation asyncVM2 = vm2.invokeAsync(() -> { + AsyncInvocation asyncVM2 = vm2.invokeAsync(() -> { try (IgnoredException ie = addIgnoredException(RegionDestroyedException.class)) { Cache cache = getCache(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionLowBucketRedundancyDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionLowBucketRedundancyDistributedTest.java index 7812bb321bc1..47a30b1c1b27 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionLowBucketRedundancyDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionLowBucketRedundancyDistributedTest.java @@ -154,9 +154,9 @@ public void testFourServersWithPersistentRegionAndOneRedundantCopy() throws Exce // Asynchronously recreate the regions in servers 1 and 2 (since they are recovering persistent // data) - AsyncInvocation recreateRegionInServer1 = + AsyncInvocation recreateRegionInServer1 = server1.getVM().invokeAsync(() -> createRegion(PARTITION_PERSISTENT, 1)); - AsyncInvocation recreateRegionInServer2 = + AsyncInvocation recreateRegionInServer2 = server2.getVM().invokeAsync(() -> createRegion(PARTITION_PERSISTENT, 1)); recreateRegionInServer1.await(); recreateRegionInServer2.await(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java index c177d14bcff0..686c1f430351 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PersistentRegionRecoveryDUnitTest.java @@ -235,7 +235,7 @@ public void testRecoveryOfAsyncRegionAfterGiiFailureAndShutdown() throws Excepti getBlackboard())); }); - AsyncInvocation asyncVM1 = vm1.invokeAsync(() -> createAsyncDiskRegion()); + AsyncInvocation asyncVM1 = vm1.invokeAsync(() -> createAsyncDiskRegion()); logger.info("##### After async create region in vm1"); @@ -293,7 +293,7 @@ public void testRecoveryOfSyncRegionAfterGiiFailureAndShutdown() throws Exceptio getBlackboard())); }); - AsyncInvocation asyncVM1 = vm1.invokeAsync(this::createSyncDiskRegion); + AsyncInvocation asyncVM1 = vm1.invokeAsync(this::createSyncDiskRegion); logger.info("##### After async create region in vm1"); @@ -439,7 +439,7 @@ public void beforeProcessMessage(ClusterDistributionManager dm, }); }); - AsyncInvocation vm0createRegion = vm0.invokeAsync(() -> createAsyncDiskRegion(true)); + AsyncInvocation vm0createRegion = vm0.invokeAsync(() -> createAsyncDiskRegion(true)); vm1.invoke(() -> { await().until(() -> getBlackboard().isGateSignaled("GotRegionIIRequest")); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PutAllGlobalDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PutAllGlobalDUnitTest.java index cb476a664425..e1f662100573 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PutAllGlobalDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PutAllGlobalDUnitTest.java @@ -33,7 +33,6 @@ import org.apache.geode.cache.AttributesFactory; import org.apache.geode.cache.Cache; -import org.apache.geode.cache.CacheException; import org.apache.geode.cache.CacheFactory; import org.apache.geode.cache.CacheTransactionManager; import org.apache.geode.cache.CacheWriter; @@ -43,7 +42,6 @@ import org.apache.geode.cache.Scope; import org.apache.geode.cache.TimeoutException; import org.apache.geode.cache.util.CacheWriterAdapter; -import org.apache.geode.cache30.CacheSerializableRunnable; import org.apache.geode.distributed.DistributedSystem; import org.apache.geode.distributed.internal.locks.DLockGrantor; import org.apache.geode.test.dunit.Assert; @@ -159,55 +157,53 @@ public void testputAllGlobalRemoteVM() throws Throwable { final int socketPort = vm0.invoke(PutAllGlobalDUnitTest::openSocket); - AsyncInvocation async1 = vm0.invokeAsync(PutAllGlobalDUnitTest::putAllMethod); + AsyncInvocation async1 = vm0.invokeAsync(PutAllGlobalDUnitTest::putAllMethod); - AsyncInvocation async2 = vm1.invokeAsync(new CacheSerializableRunnable("put from another vm") { - @Override - public void run2() throws CacheException { - long endTime = System.currentTimeMillis() + 5000; - boolean connected = false; - while (!connected && (System.currentTimeMillis() < endTime)) { - try { - Socket sock = new Socket(InetAddress.getLocalHost(), socketPort); - connected = true; - sock.close(); - } catch (IOException ioe) { - // ignored - will time out using 'endTime' + AsyncInvocation async2 = + vm1.invokeAsync("put from another vm", () -> { + long endTime = System.currentTimeMillis() + 5000; + boolean connected = false; + while (!connected && (System.currentTimeMillis() < endTime)) { try { - Thread.sleep(500); - } catch (InterruptedException ie) { - fail("Interrupted while waiting for async1 invocation"); + Socket sock = new Socket(InetAddress.getLocalHost(), socketPort); + connected = true; + sock.close(); + } catch (IOException ioe) { + // ignored - will time out using 'endTime' + try { + Thread.sleep(500); + } catch (InterruptedException ie) { + fail("Interrupted while waiting for async1 invocation"); + } } } - } - if (!connected) { - fail("unable to connect to async1 invocation"); - } - long startTime = 0; - try { - Thread.sleep(500); - LogWriterUtils.getLogWriter().info("async2 proceeding with put operation"); - startTime = System.currentTimeMillis(); - region.put(1, "mapVal"); - LogWriterUtils.getLogWriter().info("async2 done with put operation"); - fail("Should have thrown TimeoutException"); - } catch (TimeoutException Tx) { - // Tx.printStackTrace(); - LogWriterUtils.getLogWriter().info("PASS: As expected Caught TimeoutException "); - if (startTime + TIMEOUT_PERIOD - + DLockGrantor.GRANTOR_THREAD_MAX_WAIT /* slop of grantor max wait ms */ < System - .currentTimeMillis()) { - LogWriterUtils.getLogWriter() - .warning("though this test passed, the put() timed out in " - + (System.currentTimeMillis() - startTime) + " instead of the expected " - + TIMEOUT_PERIOD + " milliseconds"); + if (!connected) { + fail("unable to connect to async1 invocation"); } - } catch (Exception ex) { - Assert.fail("async2 threw unexpected exception", ex); - // ex.printStackTrace(); - } - } - }); + long startTime = 0; + try { + Thread.sleep(500); + LogWriterUtils.getLogWriter().info("async2 proceeding with put operation"); + startTime = System.currentTimeMillis(); + region.put(1, "mapVal"); + LogWriterUtils.getLogWriter().info("async2 done with put operation"); + fail("Should have thrown TimeoutException"); + } catch (TimeoutException Tx) { + // Tx.printStackTrace(); + LogWriterUtils.getLogWriter().info("PASS: As expected Caught TimeoutException "); + if (startTime + TIMEOUT_PERIOD + + DLockGrantor.GRANTOR_THREAD_MAX_WAIT /* slop of grantor max wait ms */ < System + .currentTimeMillis()) { + LogWriterUtils.getLogWriter() + .warning("though this test passed, the put() timed out in " + + (System.currentTimeMillis() - startTime) + " instead of the expected " + + TIMEOUT_PERIOD + " milliseconds"); + } + } catch (Exception ex) { + Assert.fail("async2 threw unexpected exception", ex); + // ex.printStackTrace(); + } + }); ThreadUtils.join(async2, 30 * 1000); if (async2.exceptionOccurred()) { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RebalanceWhileCreatingRegionDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RebalanceWhileCreatingRegionDistributedTest.java index 1acb02336fba..053f80bd962c 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RebalanceWhileCreatingRegionDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RebalanceWhileCreatingRegionDistributedTest.java @@ -83,7 +83,7 @@ public void testRebalanceDuringRegionCreation() throws Exception { server2.invoke(() -> createRegion(regionName, RegionShortcut.PARTITION)); // Asynchronously wait to create the proxy region in the accessor - AsyncInvocation asyncInvocation = + AsyncInvocation asyncInvocation = accessor.invokeAsync(() -> waitToCreateProxyRegion(regionName)); // Connect client1 @@ -180,7 +180,7 @@ public void testMoveSingleBucketDuringRegionCreation() throws Exception { }); // Asynchronously wait to create the proxy region in the accessor - AsyncInvocation asyncInvocation = accessor.invokeAsync(() -> { + AsyncInvocation asyncInvocation = accessor.invokeAsync(() -> { waitToCreateSingleBucketProxyRegion(regionName); }); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RemoveGlobalDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RemoveGlobalDUnitTest.java index 46c312e3f8a9..5ed4111f02a4 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RemoveGlobalDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/RemoveGlobalDUnitTest.java @@ -120,7 +120,7 @@ public void run2() throws CacheException { vm0.invoke(createRegionWithWriter); - AsyncInvocation async = vm0.invokeAsync(new CacheSerializableRunnable("put object") { + AsyncInvocation async = vm0.invokeAsync(new CacheSerializableRunnable("put object") { @Override public void run2() throws CacheException { for (int i = 1; i < 5; i++) { @@ -210,7 +210,7 @@ public void run2() throws CacheException { } }); - AsyncInvocation async = vm0.invokeAsync(new CacheSerializableRunnable("remove object") { + AsyncInvocation async = vm0.invokeAsync(new CacheSerializableRunnable("remove object") { @Override public void run2() throws CacheException { region.remove(2); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ReplicateEntryIdleExpirationDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ReplicateEntryIdleExpirationDistributedTest.java index bcb992a15616..c149e24a6c03 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ReplicateEntryIdleExpirationDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ReplicateEntryIdleExpirationDistributedTest.java @@ -95,7 +95,7 @@ public void tearDown() throws Exception { @Test public void readsInOtherMemberShouldPreventExpiration() throws Exception { - AsyncInvocation memberReading = member3.invokeAsync(() -> { + AsyncInvocation memberReading = member3.invokeAsync(() -> { Region region = cacheRule.getCache().getRegion(regionName); region.put(KEY, VALUE); while (KEEP_READING.get()) { @@ -140,7 +140,7 @@ public void readsInNormalMemberShouldPreventExpiration() throws Exception { factory.setEntryIdleTimeout(new ExpirationAttributes(1, DESTROY)); factory.create(regionName); }); - AsyncInvocation memberReading = member4.invokeAsync(() -> { + AsyncInvocation memberReading = member4.invokeAsync(() -> { Region region = cacheRule.getCache().getRegion(regionName); region.put(KEY, VALUE); while (KEEP_READING.get()) { @@ -179,7 +179,7 @@ public void readsInOtherMemberShouldPreventExpirationWhenEvictionEnabled() throw member1.invoke(() -> createEvictionRegion(evictionRegionName)); member2.invoke(() -> createEvictionRegion(evictionRegionName)); member3.invoke(() -> createEvictionRegion(evictionRegionName)); - AsyncInvocation memberReading = member3.invokeAsync(() -> { + AsyncInvocation memberReading = member3.invokeAsync(() -> { Region region = cacheRule.getCache().getRegion(evictionRegionName); region.put(KEY, VALUE); while (KEEP_READING.get()) { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/TransactionsWithGIIDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/TransactionsWithGIIDistributedTest.java index 592bd1d6c759..93b1f64122a5 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/TransactionsWithGIIDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/TransactionsWithGIIDistributedTest.java @@ -112,8 +112,8 @@ private void createPartitionedRegion(String regionName) { } private void doConcurrentOpsAndRebalance(String s, boolean doRebalance) throws Exception { - AsyncInvocation async0 = vm0.invokeAsync(this::doConcurrentDestroyInTx); - AsyncInvocation async1; + AsyncInvocation async0 = vm0.invokeAsync(this::doConcurrentDestroyInTx); + AsyncInvocation async1; if (doRebalance) { async1 = vm1.invokeAsync(() -> doConcurrentPutInTx(s)); } else { @@ -279,7 +279,7 @@ public void correctVersionGeneratedForConcurrentOperationsInTxInReplicateRegion( cacheRule.getOrCreateCache(); }); - AsyncInvocation async = vm1.invokeAsync(() -> createRegion(regionName)); + AsyncInvocation async = vm1.invokeAsync(() -> createRegion(regionName)); doConcurrentOpsAndRebalance("C", false); async.await(); validateVersionsInVms(false, vm0, vm1); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/backup/BackupDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/backup/BackupDistributedTest.java index 97f9fb2546ce..ce94a9ead9eb 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/backup/BackupDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/backup/BackupDistributedTest.java @@ -247,7 +247,7 @@ public void testBackupDuringGII() throws Exception { createTestHookToCreateRegionBeforeSendingPrepareBackupRequest()); }); - AsyncInvocation asyncVM1CreateRegion = vm1.invokeAsync(() -> { + AsyncInvocation asyncVM1CreateRegion = vm1.invokeAsync(() -> { getBlackboard().waitForGate("createRegion", 30, SECONDS); createReplicatedRegion(regionName2, diskStoreName, getDiskStoreFor(vm1), false, true); getBlackboard().signalGate("createdRegion"); @@ -277,11 +277,11 @@ public void testBackupDuringGII() throws Exception { getCache().getPartitionedRegionLockService().becomeLockGrantor(); }); - AsyncInvocation asyncVM1Region1 = vm1.invokeAsync(() -> { + AsyncInvocation asyncVM1Region1 = vm1.invokeAsync(() -> { createReplicatedRegion(regionName1, diskStoreName, getDiskStoreFor(vm1), true, true); }); - AsyncInvocation asyncVM1Region2 = vm1.invokeAsync(() -> { + AsyncInvocation asyncVM1Region2 = vm1.invokeAsync(() -> { createReplicatedRegion(regionName2, diskStoreName, getDiskStoreFor(vm1), false, true); getBlackboard().signalGate("createdRegionAfterRecovery"); }); @@ -554,7 +554,7 @@ public void testRecoverySystemWithConcurrentPutter() throws Exception { restoreBackup(2); // in vm0, start doing a bunch of concurrent puts. - AsyncInvocation putsInVM0 = vm0.invokeAsync(() -> { + AsyncInvocation putsInVM0 = vm0.invokeAsync(() -> { Region region = getCache().getRegion(regionName1); try { for (int i = 0;; i++) { @@ -569,8 +569,8 @@ public void testRecoverySystemWithConcurrentPutter() throws Exception { } }); - AsyncInvocation createRegionsInVM1 = vm1.invokeAsync(() -> createColocatedRegions(vm1)); - AsyncInvocation createRegionsInVM2 = vm2.invokeAsync(() -> createColocatedRegions(vm2)); + AsyncInvocation createRegionsInVM1 = vm1.invokeAsync(() -> createColocatedRegions(vm1)); + AsyncInvocation createRegionsInVM2 = vm2.invokeAsync(() -> createColocatedRegions(vm2)); createRegionsInVM1.await(); createRegionsInVM2.await(); @@ -706,11 +706,11 @@ public void beforeSendMessage(ClusterDistributionManager dm, DistributionMessage private void createPersistentRegions(final VM... vms) throws ExecutionException, InterruptedException { - Set createRegionAsyncs = new HashSet<>(); + Set> createRegionAsyncs = new HashSet<>(); for (VM vm : vms) { createRegionAsyncs.add(vm.invokeAsync(() -> createRegions(vm))); } - for (AsyncInvocation createRegion : createRegionAsyncs) { + for (AsyncInvocation createRegion : createRegionAsyncs) { createRegion.await(); } } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/control/RebalanceOperationDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/control/RebalanceOperationDistributedTest.java index 820c050b2df8..d1045b9a30a2 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/control/RebalanceOperationDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/control/RebalanceOperationDistributedTest.java @@ -1879,10 +1879,10 @@ public void testRecoverRedundancyWithOfflinePersistence(boolean simulate, boolea // We need to restart both VMs at the same time, because // they will wait for each other before allowing operations. - AsyncInvocation createRegionOnVM0 = vm0.invokeAsync( + AsyncInvocation createRegionOnVM0 = vm0.invokeAsync( () -> createPersistentPartitionedRegion("region1", getUniqueName(), getDiskDirs(), redundantCopies)); - AsyncInvocation createRegionOnVM2 = vm2.invokeAsync( + AsyncInvocation createRegionOnVM2 = vm2.invokeAsync( () -> createPersistentPartitionedRegion("region1", getUniqueName(), getDiskDirs(), redundantCopies)); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java index 8724d616b169..456ca9f54136 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/DistributedRegionFunctionExecutionDUnitTest.java @@ -256,7 +256,7 @@ public void testDistributedRegionFunctionExecutionOnDataPolicyReplicateNotTimedO empty.invoke(() -> populateRegion(200)); - AsyncInvocation executeFunctionInReplicate1 = replicate1.invokeAsync(() -> { + AsyncInvocation executeFunctionInReplicate1 = replicate1.invokeAsync(() -> { ResultCollector> resultCollector = TypedFunctionService .>onRegion(getRegion()) .withFilter(filter) diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/FunctionRetryTestBase.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/FunctionRetryTestBase.java index 5cf5703ed3fc..55efa5e05774 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/FunctionRetryTestBase.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/FunctionRetryTestBase.java @@ -141,7 +141,7 @@ public Function testFunctionRetry( IgnoredException.addIgnoredException(FunctionException.class.getName()); - AsyncInvocation clientExecuteAsync = client.invokeAsync(() -> { + AsyncInvocation clientExecuteAsync = client.invokeAsync(() -> { assertThat(executionTarget).isNotNull(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java index c113130253fc..c80da6cef4b8 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionDUnitTest.java @@ -703,23 +703,6 @@ public static void executeFunction() { } } - static Object executeFunctionHA() { - Region region = cache.getRegion(PartitionedRegionName); - final HashSet testKeysSet = new HashSet<>(); - for (int i = (totalNumBuckets * 10); i > 0; i--) { - testKeysSet.add("execKey-" + i); - } - DistributedSystem.setThreadsSocketPolicy(false); - Function function = new TestFunction(true, TestFunction.TEST_FUNCTION_HA); - FunctionService.registerFunction(function); - Execution dataSet = FunctionService.onRegion(region); - ResultCollector rc1 = - dataSet.withFilter(testKeysSet).setArguments(Boolean.TRUE).execute(function.getId()); - List l = ((List) rc1.getResult()); - logger.info("Result size : " + l.size()); - return l; - } - static void putOperation() { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java index efff693fd102..41b3e463e6d9 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionFailoverDUnitTest.java @@ -101,7 +101,7 @@ public void testserverMultiKeyExecution_SocektTimeOut() { * failover to other available server */ @Test - public void testServerFailoverWithTwoServerAliveHA() { + public void testServerFailoverWithTwoServerAliveHA() throws InterruptedException { IgnoredException.addIgnoredException("FunctionInvocationTargetException"); ArrayList commonAttributes = createCommonServerAttributes("TestPartitionedRegion", null, 1, null); @@ -111,20 +111,18 @@ public void testServerFailoverWithTwoServerAliveHA() { server2.invoke(PRClientServerRegionFunctionExecutionDUnitTest::stopServerHA); server3.invoke(PRClientServerRegionFunctionExecutionDUnitTest::stopServerHA); client.invoke(PRClientServerRegionFunctionExecutionDUnitTest::putOperation); - int AsyncInvocationArrSize = 1; - AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize]; - async[0] = client + AsyncInvocation> async = client .invokeAsync(PRClientServerRegionFunctionExecutionDUnitTest::executeFunctionHA); server2.invoke(PRClientServerRegionFunctionExecutionDUnitTest::startServerHA); server3.invoke(PRClientServerRegionFunctionExecutionDUnitTest::startServerHA); server1.invoke(PRClientServerRegionFunctionExecutionDUnitTest::stopServerHA); client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest .verifyDeadAndLiveServers(2)); - ThreadUtils.join(async[0], 6 * 60 * 1000); - if (async[0].getException() != null) { - Assert.fail("UnExpected Exception Occurred : ", async[0].getException()); + ThreadUtils.join(async, 6 * 60 * 1000); + if (async.getException() != null) { + Assert.fail("UnExpected Exception Occurred : ", async.getException()); } - List l = (List) async[0].getReturnValue(); + List l = async.get(); assertEquals(2, l.size()); } @@ -133,7 +131,7 @@ public void testServerFailoverWithTwoServerAliveHA() { * failover to other available server */ @Test - public void testServerCacheClosedFailoverWithTwoServerAliveHA() { + public void testServerCacheClosedFailoverWithTwoServerAliveHA() throws InterruptedException { IgnoredException.addIgnoredException("FunctionInvocationTargetException"); ArrayList commonAttributes = createCommonServerAttributes("TestPartitionedRegion", null, 1, null); @@ -143,20 +141,18 @@ public void testServerCacheClosedFailoverWithTwoServerAliveHA() { server2.invoke(PRClientServerRegionFunctionExecutionDUnitTest::stopServerHA); server3.invoke(PRClientServerRegionFunctionExecutionDUnitTest::stopServerHA); client.invoke(PRClientServerRegionFunctionExecutionDUnitTest::putOperation); - int AsyncInvocationArrSize = 1; - AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize]; - async[0] = client + AsyncInvocation> async = client .invokeAsync(PRClientServerRegionFunctionExecutionDUnitTest::executeFunctionHA); server2.invoke(PRClientServerRegionFunctionExecutionDUnitTest::startServerHA); server3.invoke(PRClientServerRegionFunctionExecutionDUnitTest::startServerHA); server1.invoke(PRClientServerRegionFunctionExecutionDUnitTest::closeCacheHA); client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest .verifyDeadAndLiveServers(2)); - ThreadUtils.join(async[0], 5 * 60 * 1000); - if (async[0].getException() != null) { - Assert.fail("UnExpected Exception Occurred : ", async[0].getException()); + ThreadUtils.join(async, 5 * 60 * 1000); + if (async.getException() != null) { + Assert.fail("UnExpected Exception Occurred : ", async.getException()); } - List l = (List) async[0].getReturnValue(); + List l = async.get(); assertEquals(2, l.size()); } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest.java index 1c66b3d2e0b7..0f4f768cd0ae 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest.java @@ -338,9 +338,7 @@ public void testServerFailoverWithTwoServerAliveHA() throws InterruptedException server3.invoke(PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest::stopServerHA); client.invoke(PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest::putOperation); - int AsyncInvocationArrSize = 1; - AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize]; - async[0] = client.invokeAsync( + AsyncInvocation> async = client.invokeAsync( PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest::executeFunctionHA); server2.invoke(PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest::startServerHA); server3.invoke(PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest::startServerHA); @@ -348,7 +346,7 @@ public void testServerFailoverWithTwoServerAliveHA() throws InterruptedException client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest .verifyDeadAndLiveServers(2)); - List l = (List) async[0].get(); + List l = async.get(); assertThat(l).hasSize(2); } @@ -368,9 +366,8 @@ public void testServerCacheClosedFailoverWithTwoServerAliveHA() throws Interrupt server2.invoke(PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest::stopServerHA); server3.invoke(PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest::stopServerHA); client.invoke(PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest::putOperation); - int AsyncInvocationArrSize = 1; - AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize]; - async[0] = client.invokeAsync( + + AsyncInvocation> async = client.invokeAsync( PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest::executeFunctionHA); server2.invoke(PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest::startServerHA); server3.invoke(PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest::startServerHA); @@ -378,7 +375,7 @@ public void testServerCacheClosedFailoverWithTwoServerAliveHA() throws Interrupt client.invoke(() -> PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest .verifyDeadAndLiveServers(2)); - List l = (List) async[0].get(); + List l = async.get(); assertThat(l).hasSize(2); } @@ -552,23 +549,6 @@ public static void executeFunction() { } } - private static Object executeFunctionHA() { - Region region = cache.getRegion(PartitionedRegionName); - final HashSet testKeysSet = new HashSet<>(); - for (int i = (totalNumBuckets * 10); i > 0; i--) { - testKeysSet.add("execKey-" + i); - } - DistributedSystem.setThreadsSocketPolicy(false); - Function function = new TestFunction<>(true, TestFunction.TEST_FUNCTION_HA); - FunctionService.registerFunction(function); - Execution dataSet = FunctionService.onRegion(region); - ResultCollector rc1 = - dataSet.withFilter(testKeysSet).setArguments(Boolean.TRUE).execute(function.getId()); - List l = ((List) rc1.getResult()); - logger.info("Result size : " + l.size()); - return l; - } - private static void putOperation() { Region region = cache.getRegion(PartitionedRegionName); assertThat(region).isNotNull(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java index 8f0da5738456..dca92ea15af8 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest.java @@ -295,7 +295,7 @@ public void testserverMultiKeyExecutionOnASingleBucket_byInstance() { * failover to other available server */ @Test - public void testServerFailoverWithTwoServerAliveHA() { + public void testServerFailoverWithTwoServerAliveHA() throws InterruptedException { IgnoredException.addIgnoredException("FunctionInvocationTargetException"); IgnoredException.addIgnoredException("Connection reset"); IgnoredException.addIgnoredException("SocketTimeoutException"); @@ -313,11 +313,8 @@ public void testServerFailoverWithTwoServerAliveHA() { client.invoke( PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest::putOperation); - int AsyncInvocationArrSize = 1; - AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize]; - async[0] = - client.invokeAsync( - PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest::executeFunctionHA); + AsyncInvocation> async = client.invokeAsync( + PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest::executeFunctionHA); server2.invoke( PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest::startServerHA); server3.invoke( @@ -326,13 +323,13 @@ public void testServerFailoverWithTwoServerAliveHA() { PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest::stopServerHA); client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest .verifyDeadAndLiveServers(2)); - ThreadUtils.join(async[0], 6 * 60 * 1000); - if (async[0].getException() != null) { - Assert.fail("UnExpected Exception Occurred : ", async[0].getException()); + ThreadUtils.join(async, 6 * 60 * 1000); + if (async.getException() != null) { + Assert.fail("UnExpected Exception Occurred : ", async.getException()); } - List l = (List) async[0].getReturnValue(); + List booleanList = async.get(); - assertEquals(2, l.size()); + assertEquals(2, booleanList.size()); } /* @@ -340,7 +337,7 @@ public void testServerFailoverWithTwoServerAliveHA() { * failover to other available server */ @Test - public void testServerCacheClosedFailoverWithTwoServerAliveHA() { + public void testServerCacheClosedFailoverWithTwoServerAliveHA() throws InterruptedException { IgnoredException.addIgnoredException("FunctionInvocationTargetException"); IgnoredException.addIgnoredException("Connection reset"); IgnoredException.addIgnoredException("SocketTimeoutException"); @@ -357,11 +354,9 @@ public void testServerCacheClosedFailoverWithTwoServerAliveHA() { PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest::stopServerHA); client.invoke( PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest::putOperation); - int AsyncInvocationArrSize = 1; - AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize]; - async[0] = - client.invokeAsync( - PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest::executeFunctionHA); + + AsyncInvocation> async = client.invokeAsync( + PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest::executeFunctionHA); server2.invoke( PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest::startServerHA); server3.invoke( @@ -370,11 +365,11 @@ public void testServerCacheClosedFailoverWithTwoServerAliveHA() { PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest::closeCacheHA); client.invoke(() -> PRClientServerRegionFunctionExecutionSelectorNoSingleHopDUnitTest .verifyDeadAndLiveServers(2)); - ThreadUtils.join(async[0], 5 * 60 * 1000); - if (async[0].getException() != null) { - Assert.fail("UnExpected Exception Occurred : ", async[0].getException()); + ThreadUtils.join(async, 5 * 60 * 1000); + if (async.getException() != null) { + Assert.fail("UnExpected Exception Occurred : ", async.getException()); } - List l = (List) async[0].getReturnValue(); + List l = async.get(); assertEquals(2, l.size()); } @@ -474,23 +469,6 @@ public static void executeFunction() { } } - private static Object executeFunctionHA() { - Region region = cache.getRegion(PartitionedRegionName); - final HashSet testKeysSet = new HashSet<>(); - for (int i = (totalNumBuckets * 10); i > 0; i--) { - testKeysSet.add("execKey-" + i); - } - DistributedSystem.setThreadsSocketPolicy(false); - Function function = new TestFunction(true, TestFunction.TEST_FUNCTION_HA); - FunctionService.registerFunction(function); - Execution dataSet = FunctionService.onRegion(region); - ResultCollector rc1 = - dataSet.withFilter(testKeysSet).setArguments(Boolean.TRUE).execute(function.getId()); - List l = ((List) rc1.getResult()); - logger.info("Result size : " + l.size()); - return l; - } - private static void putOperation() { Region region = cache.getRegion(PartitionedRegionName); assertNotNull(region); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java index e0e9e78585c3..4d8be24a32fa 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionSingleHopDUnitTest.java @@ -349,7 +349,7 @@ public void testserverMultiKeyExecutionOnASingleBucket_byInstance() { * failover to other available server */ @Test - public void testServerFailoverWithTwoServerAliveHA() { + public void testServerFailoverWithTwoServerAliveHA() throws InterruptedException { ArrayList commonAttributes = createCommonServerAttributes("TestPartitionedRegion", null, 1, null); createClientServerScenarion(commonAttributes, 20, 20, 20); @@ -359,20 +359,18 @@ public void testServerFailoverWithTwoServerAliveHA() { server3.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest::stopServerHA); client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest::putOperation); - int AsyncInvocationArrSize = 1; - AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize]; - async[0] = client.invokeAsync( + AsyncInvocation> async = client.invokeAsync( PRClientServerRegionFunctionExecutionSingleHopDUnitTest::executeFunctionHA); server2.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest::startServerHA); server3.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest::startServerHA); server1.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest::stopServerHA); client.invoke(() -> PRClientServerRegionFunctionExecutionDUnitTest .verifyDeadAndLiveServers(2)); - ThreadUtils.join(async[0], 6 * 60 * 1000); - if (async[0].getException() != null) { - Assert.fail("UnExpected Exception Occurred : ", async[0].getException()); + ThreadUtils.join(async, 6 * 60 * 1000); + if (async.getException() != null) { + Assert.fail("UnExpected Exception Occurred : ", async.getException()); } - List l = (List) async[0].getReturnValue(); + List l = async.get(); assertEquals(2, l.size()); } @@ -382,7 +380,7 @@ public void testServerFailoverWithTwoServerAliveHA() { * failover to other available server */ @Test - public void testServerCacheClosedFailoverWithTwoServerAliveHA() { + public void testServerCacheClosedFailoverWithTwoServerAliveHA() throws InterruptedException { ArrayList commonAttributes = createCommonServerAttributes("TestPartitionedRegion", null, 1, null); createClientServerScenarion(commonAttributes, 20, 20, 20); @@ -391,20 +389,19 @@ public void testServerCacheClosedFailoverWithTwoServerAliveHA() { server2.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest::stopServerHA); server3.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest::stopServerHA); client.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest::putOperation); - int AsyncInvocationArrSize = 1; - AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize]; - async[0] = client.invokeAsync( + + AsyncInvocation> async = client.invokeAsync( PRClientServerRegionFunctionExecutionSingleHopDUnitTest::executeFunctionHA); server2.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest::startServerHA); server3.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest::startServerHA); server1.invoke(PRClientServerRegionFunctionExecutionSingleHopDUnitTest::closeCacheHA); client.invoke(() -> PRClientServerRegionFunctionExecutionSingleHopDUnitTest .verifyDeadAndLiveServers(2)); - ThreadUtils.join(async[0], 5 * 60 * 1000); - if (async[0].getException() != null) { - Assert.fail("UnExpected Exception Occurred : ", async[0].getException()); + ThreadUtils.join(async, 5 * 60 * 1000); + if (async.getException() != null) { + Assert.fail("UnExpected Exception Occurred : ", async.getException()); } - List l = (List) async[0].getReturnValue(); + List l = async.get(); assertEquals(2, l.size()); } @@ -547,23 +544,6 @@ public static void executeFunction() { } } - private static Object executeFunctionHA() { - Region region = cache.getRegion(PartitionedRegionName); - final HashSet testKeysSet = new HashSet<>(); - for (int i = (totalNumBuckets * 10); i > 0; i--) { - testKeysSet.add("execKey-" + i); - } - DistributedSystem.setThreadsSocketPolicy(false); - Function function = new TestFunction(true, TestFunction.TEST_FUNCTION_HA); - FunctionService.registerFunction(function); - Execution dataSet = FunctionService.onRegion(region); - ResultCollector rc1 = - dataSet.withFilter(testKeysSet).setArguments(Boolean.TRUE).execute(function.getId()); - List l = ((List) rc1.getResult()); - logger.info("Result size : " + l.size()); - return l; - } - public Object executeFunctionOnPartitionedRegion(String regionName, String functionName, Set filter, Object arguments) { Region region = cache.getRegion(regionName); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerTestBase.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerTestBase.java index 107b50a26efa..2983467328cb 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerTestBase.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerTestBase.java @@ -47,6 +47,7 @@ import org.apache.geode.cache.client.PoolFactory; import org.apache.geode.cache.client.PoolManager; import org.apache.geode.cache.client.internal.PoolImpl; +import org.apache.geode.cache.execute.Execution; import org.apache.geode.cache.execute.Function; import org.apache.geode.cache.execute.FunctionService; import org.apache.geode.cache.execute.ResultCollector; @@ -616,6 +617,23 @@ static void closeCacheHA() { } } + protected static List executeFunctionHA() { + Region region = cache.getRegion(PartitionedRegionName); + final HashSet testKeysSet = new HashSet<>(); + for (int i = (totalNumBuckets * 10); i > 0; i--) { + testKeysSet.add("execKey-" + i); + } + DistributedSystem.setThreadsSocketPolicy(false); + Function function = new TestFunction(true, TestFunction.TEST_FUNCTION_HA); + FunctionService.registerFunction(function); + Execution dataSet = FunctionService.onRegion(region); + ResultCollector rc1 = + dataSet.withFilter(testKeysSet).setArguments(Boolean.TRUE).execute(function.getId()); + List list = ((List) rc1.getResult()); + logger.info("Result size : " + list.size()); + return list; + } + void serverBucketFilterExecution(Set bucketFilterSet) { Region region = cache.getRegion(PartitionedRegionName); assertThat(region).isNotNull(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRColocationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRColocationDUnitTest.java index a8f7af486ccd..c2fd8b753b64 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRColocationDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRColocationDUnitTest.java @@ -1848,9 +1848,9 @@ public void run() { Object[] attributeObjects2 = new Object[] {regionName, redundancy, localMaxmemory, totalNumBuckets, colocatedWith, isPartitionResolver}; - AsyncInvocation async1 = + AsyncInvocation async1 = dataStore1.invokeAsync(PRColocationDUnitTest.class, "createPR", attributeObjects2); - AsyncInvocation async2 = + AsyncInvocation async2 = dataStore2.invokeAsync(PRColocationDUnitTest.class, "createPR", attributeObjects2); async1.join(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ha/HAGIIBugDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ha/HAGIIBugDUnitTest.java index 71e085c13755..f87f3a8f19dc 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ha/HAGIIBugDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ha/HAGIIBugDUnitTest.java @@ -181,7 +181,7 @@ public void run() { } }; - AsyncInvocation[] async = new AsyncInvocation[4]; + AsyncInvocation[] async = new AsyncInvocation[4]; async[0] = vm0.invokeAsync(putFrmVm("vm0_2")); t1.start(); ThreadUtils.join(t1, 30 * 1000); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentColocatedPartitionedRegionDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentColocatedPartitionedRegionDistributedTest.java index c308aadc2019..f4ccfd2eff60 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentColocatedPartitionedRegionDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentColocatedPartitionedRegionDistributedTest.java @@ -342,7 +342,7 @@ public void testMissingColocatedParentPRWherePRConfigExists() throws Exception { latch = new CountDownLatch(1); }); - AsyncInvocation createPRsInVM0 = vm0.invokeAsync(() -> { + AsyncInvocation createPRsInVM0 = vm0.invokeAsync(() -> { createCache(); createDiskStore(diskStoreName1); createPR_withPersistence(regionName, diskStoreName1, DEFAULT_RECOVERY_DELAY, diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionHangsDuringRestartRegressionTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionHangsDuringRestartRegressionTest.java index 012385740731..848330b678ba 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionHangsDuringRestartRegressionTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionHangsDuringRestartRegressionTest.java @@ -153,7 +153,8 @@ public void doesNotWaitForPreviousInstanceOfOnlineServer() throws Exception { try (IgnoredException ie = addIgnoredException(PartitionOfflineException.class)) { // This should recover redundancy, which should cause vm0 to bounce/disconnect - AsyncInvocation createPRAsync = vm1.invokeAsync(() -> createPartitionedRegion(1, 0, 1, true)); + AsyncInvocation createPRAsync = + vm1.invokeAsync(() -> createPartitionedRegion(1, 0, 1, true)); beforeBounceLatch.await(TIMEOUT_MILLIS, MILLISECONDS); vm0.bounceForcibly(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java index bd40f86ebdcf..753095ad3f77 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionTestBase.java @@ -200,7 +200,7 @@ protected RegionAttributes getPersistentPRAttributes(final int redundancy, return attributesFactory.create(); } - AsyncInvocation createPRAsync(final VM vm, final int redundancy) { + AsyncInvocation createPRAsync(final VM vm, final int redundancy) { return vm.invokeAsync(getCreatePRRunnable(redundancy, -1)); } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionWithTransactionDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionWithTransactionDUnitTest.java index 9a70196238e4..04b9382db3f2 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionWithTransactionDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/PersistentPartitionedRegionWithTransactionDUnitTest.java @@ -94,9 +94,9 @@ public void testRollback() throws Throwable { closeCache(vm1); closeCache(vm2); - AsyncInvocation a1 = createPRAsync(vm0, redundancy); - AsyncInvocation a2 = createPRAsync(vm1, redundancy); - AsyncInvocation a3 = createPRAsync(vm2, redundancy); + AsyncInvocation a1 = createPRAsync(vm0, redundancy); + AsyncInvocation a2 = createPRAsync(vm1, redundancy); + AsyncInvocation a3 = createPRAsync(vm2, redundancy); a1.getResult(MAX_WAIT); a2.getResult(MAX_WAIT); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/ShutdownAllDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/ShutdownAllDUnitTest.java index 47ffa8b4786f..cf6b2e2a7680 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/ShutdownAllDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/ShutdownAllDUnitTest.java @@ -114,10 +114,10 @@ public void testShutdownAll2Servers() throws Throwable { assertTrue(InternalDistributedSystem.getExistingSystems().isEmpty()); // restart vm0 - AsyncInvocation a0 = createRegionAsync(vm0, "region", "disk", true, 1); + AsyncInvocation a0 = createRegionAsync(vm0, "region", "disk", true, 1); // restart vm1 - AsyncInvocation a1 = createRegionAsync(vm1, "region", "disk", true, 1); + AsyncInvocation a1 = createRegionAsync(vm1, "region", "disk", true, 1); a0.getResult(MAX_WAIT); a1.getResult(MAX_WAIT); @@ -215,7 +215,7 @@ public void testShutdownAllInterruptsCacheCreation() closeAllCache(); // in vm0 create the cache in a way that hangs until // it sees that a shutDownAll is in progress - AsyncInvocation asyncCreate = vm0.invokeAsync(() -> { + AsyncInvocation asyncCreate = vm0.invokeAsync(() -> { cll = new CacheLifecycleListener() { @Override public void cacheCreated(InternalCache cache) { @@ -321,11 +321,11 @@ public void testShutdownAllFromServer() throws Throwable { assertTrue(InternalDistributedSystem.getExistingSystems().isEmpty()); // restart vm0, vm1, vm2 - AsyncInvocation a0 = createRegionAsync(vm0, "region", "disk", true, 1); + AsyncInvocation a0 = createRegionAsync(vm0, "region", "disk", true, 1); - AsyncInvocation a1 = createRegionAsync(vm1, "region", "disk", true, 1); + AsyncInvocation a1 = createRegionAsync(vm1, "region", "disk", true, 1); - AsyncInvocation a2 = createRegionAsync(vm2, "region", "disk", true, 1); + AsyncInvocation a2 = createRegionAsync(vm2, "region", "disk", true, 1); a0.getResult(MAX_WAIT); a1.getResult(MAX_WAIT); @@ -353,13 +353,13 @@ public void testCleanStop() throws Throwable { shutDownAllMembers(vm2, 2); - AsyncInvocation a0 = createRegionAsync(vm0, "region", "disk", true, 1); + AsyncInvocation a0 = createRegionAsync(vm0, "region", "disk", true, 1); // [dsmith] Make sure that vm0 is waiting for vm1 to recover // If VM(0) recovers early, that is a problem, because we // are no longer doing a clean recovery. Thread.sleep(500); assertTrue(a0.isAlive()); - AsyncInvocation a1 = createRegionAsync(vm1, "region", "disk", true, 1); + AsyncInvocation a1 = createRegionAsync(vm1, "region", "disk", true, 1); a0.getResult(MAX_WAIT); a1.getResult(MAX_WAIT); @@ -403,13 +403,13 @@ public void testCleanStopWithConflictCachePort() throws Throwable { shutDownAllMembers(vm2, 2); - AsyncInvocation a0 = createRegionAsync(vm0, "region", "disk", true, 1); + AsyncInvocation a0 = createRegionAsync(vm0, "region", "disk", true, 1); // [dsmith] Make sure that vm0 is waiting for vm1 to recover // If VM(0) recovers early, that is a problem, because we // are no longer doing a clean recovery. Thread.sleep(500); assertTrue(a0.isAlive()); - AsyncInvocation a1 = createRegionAsync(vm1, "region", "disk", true, 1); + AsyncInvocation a1 = createRegionAsync(vm1, "region", "disk", true, 1); a0.getResult(MAX_WAIT); a1.getResult(MAX_WAIT); @@ -484,7 +484,7 @@ public void testShutdownAllTimeout() throws Throwable { // Add a cache listener that will cause the system to hang up. // Then do some puts to get us stuck in a put. - AsyncInvocation async1 = vm0.invokeAsync(new SerializableRunnable() { + AsyncInvocation async1 = vm0.invokeAsync(new SerializableRunnable() { @Override public void run() { Region region = getCache().getRegion("region"); @@ -527,10 +527,10 @@ public void run() { Wait.pause(10000); // restart vm0 - AsyncInvocation a0 = createRegionAsync(vm0, "region", "disk", true, 1); + AsyncInvocation a0 = createRegionAsync(vm0, "region", "disk", true, 1); // restart vm1 - AsyncInvocation a1 = createRegionAsync(vm1, "region", "disk", true, 1); + AsyncInvocation a1 = createRegionAsync(vm1, "region", "disk", true, 1); a0.getResult(MAX_WAIT); a1.getResult(MAX_WAIT); @@ -572,7 +572,7 @@ public void testShutdownAllWithMembersWaiting() throws Throwable { // restart one of the members (this will hang, waiting for the other members) // restart vm0 - AsyncInvocation a0 = createRegionAsync(vm0, "region", "disk", true, 1); + AsyncInvocation a0 = createRegionAsync(vm0, "region", "disk", true, 1); // Wait a bit for the initialization to get stuck Wait.pause(20000); @@ -594,7 +594,7 @@ public void testShutdownAllWithMembersWaiting() throws Throwable { // now restart both members. This should work, but // no guarantee they'll do a clean recovery a0 = createRegionAsync(vm0, "region", "disk", true, 1); - AsyncInvocation a1 = createRegionAsync(vm1, "region", "disk", true, 1); + AsyncInvocation a1 = createRegionAsync(vm1, "region", "disk", true, 1); a0.getResult(MAX_WAIT); a1.getResult(MAX_WAIT); @@ -690,7 +690,7 @@ protected void createRegion(VM vm, final String regionName, final String diskSto } } - protected AsyncInvocation createRegionAsync(VM vm, final String regionName, + protected AsyncInvocation createRegionAsync(VM vm, final String regionName, final String diskStoreName, final boolean isPR, final int redundancy) { if (isPR) { SerializableRunnable createPR = getCreatePRRunnable(regionName, diskStoreName, redundancy); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java index b6f0458faf2e..473455f6f37a 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/partitioned/fixed/FixedPartitioningDUnitTest.java @@ -500,7 +500,7 @@ public void putWhileDataStoresAreBeingCreatedFails() throws Exception { datastore1.invoke(this::setPRObserverBeforeCalculateStartingBucketId); // Start datastore1 asynchronously. This will get stuck waiting in the PR observer - AsyncInvocation createRegionInDatastore1 = + AsyncInvocation createRegionInDatastore1 = datastore1.invokeAsync(() -> createRegionWithQuarter(QUARTER_1)); // Make sure datastore 1 gets stuck waiting on the observer @@ -508,9 +508,9 @@ public void putWhileDataStoresAreBeingCreatedFails() throws Exception { // Start two more data stores asynchronously. These will get stuck waiting for a dlock behind // datastore1 - AsyncInvocation createRegionInDatastore2 = + AsyncInvocation createRegionInDatastore2 = datastore2.invokeAsync(() -> createRegionWithQuarter(QUARTER_2)); - AsyncInvocation createRegionInDatastore3 = + AsyncInvocation createRegionInDatastore3 = datastore3.invokeAsync(() -> createRegionWithQuarter(QUARTER_3)); // Make sure a put to datastore1, which is in the middle of pr initialization, fails correctly diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentRVVRecoveryDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentRVVRecoveryDUnitTest.java index f7901fc5e8eb..d009179df75c 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentRVVRecoveryDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentRVVRecoveryDUnitTest.java @@ -427,7 +427,7 @@ public void testConflictChecksDuringConcurrentDeltaGIIAndOtherOp() throws Except }); // Do a DESTROY in vm0 when delta GII is in progress in vm1 (Hopefully, Not guaranteed). - AsyncInvocation destroyDuringDeltaGiiInVM0 = vm0.invokeAsync(() -> { + AsyncInvocation destroyDuringDeltaGiiInVM0 = vm0.invokeAsync(() -> { Region region = getCache().getRegion("prRegion"); await().until(() -> region.get("testKey").equals("testValue2")); @@ -563,14 +563,14 @@ public void testUpdateRVVWithAsyncPersistence() throws Exception { vm1.invoke(() -> createRegionWithAsyncPersistence(vm1)); // In two different threads, perform updates to the same key on the same region - AsyncInvocation doPutsInThread1InVM0 = vm1.invokeAsync(() -> { + AsyncInvocation doPutsInThread1InVM0 = vm1.invokeAsync(() -> { Region region = getCache().getRegion(regionName); for (int i = 0; i < 500; i++) { region.put("A", "vm0-" + i); } }); - AsyncInvocation doPutsInThread2InVM0 = vm1.invokeAsync(() -> { + AsyncInvocation doPutsInThread2InVM0 = vm1.invokeAsync(() -> { Region region = getCache().getRegion(regionName); for (int i = 0; i < 500; i++) { region.put("A", "vm1-" + i); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java index 1a0e3b3ef33c..d328ceae3979 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java @@ -341,7 +341,7 @@ public void testRevokeAHostBeforeInitialization() throws Exception { getCache().close(); }); - AsyncInvocation createRegionInVM0 = vm0.invokeAsync(() -> { + AsyncInvocation createRegionInVM0 = vm0.invokeAsync(() -> { createReplicateRegion(regionName, getDiskDirs(getVMId())); }); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentReplicatedTestBase.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentReplicatedTestBase.java index ed2b6308d3ae..d69312b5e09d 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentReplicatedTestBase.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentReplicatedTestBase.java @@ -105,7 +105,7 @@ void closeCache(final VM vm) { vm.invoke(() -> getCache().close()); } - AsyncInvocation closeCacheAsync(VM vm) { + AsyncInvocation closeCacheAsync(VM vm) { return vm.invokeAsync(() -> getCache().close()); } @@ -121,7 +121,7 @@ void createNonPersistentRegion(VM vm) { }); } - AsyncInvocation createPersistentRegionWithWait(VM vm) + AsyncInvocation createPersistentRegionWithWait(VM vm) throws ExecutionException, InterruptedException { return createPersistentRegion(vm, true); } @@ -130,9 +130,10 @@ void createPersistentRegion(VM vm) throws ExecutionException, InterruptedExcepti createPersistentRegion(vm, false); } - private AsyncInvocation createPersistentRegion(VM vm, boolean createPersistentRegionWillWait) + private AsyncInvocation createPersistentRegion(VM vm, + boolean createPersistentRegionWillWait) throws ExecutionException, InterruptedException { - AsyncInvocation createPersistentRegionInVM = createPersistentRegionAsync(vm); + AsyncInvocation createPersistentRegionInVM = createPersistentRegionAsync(vm); if (createPersistentRegionWillWait) { createPersistentRegionInVM.join(500); @@ -144,7 +145,7 @@ private AsyncInvocation createPersistentRegion(VM vm, boolean createPersistentRe return createPersistentRegionInVM; } - AsyncInvocation createPersistentRegionAsync(VM vm) { + AsyncInvocation createPersistentRegionAsync(VM vm) { return vm.invokeAsync(() -> { getCache(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/SlowDispatcherDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/SlowDispatcherDUnitTest.java index c0a9f24846ce..04b9c77aed66 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/SlowDispatcherDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/SlowDispatcherDUnitTest.java @@ -115,7 +115,7 @@ public void registeredInterest_durableClient_kill_primarySever_receives_marker() c -> c.withProperty(SECURITY_CLIENT_AUTH_INIT, UpdatableUserAuthInitialize.class.getName()) .withPoolSubscription(false) .withLocatorConnection(locatorPort)); - AsyncInvocation putAsync = putClient.invokeAsync(() -> { + AsyncInvocation putAsync = putClient.invokeAsync(() -> { UpdatableUserAuthInitialize.setUser("putter"); Region proxyRegion = ClusterStartupRule.clientCacheRule.createProxyRegion(PARTITION_REGION); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java index b3d34bb28434..71510d20c979 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueueStatsDUnitTest.java @@ -207,17 +207,18 @@ public void testReplicatedSerialPropagationHA() throws Exception { vm4.invoke(() -> AsyncEventQueueTestBase .createReplicatedRegionWithAsyncEventQueue(getTestMethodName() + "_RR", "ln", isOffHeap())); - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm2.invokeAsync(() -> AsyncEventQueueTestBase.doPuts(getTestMethodName() + "_RR", 10000)); Wait.pause(2000); - AsyncInvocation inv2 = vm1.invokeAsync(() -> AsyncEventQueueTestBase.killAsyncEventQueue("ln")); + AsyncInvocation inv2 = + vm1.invokeAsync(() -> AsyncEventQueueTestBase.killAsyncEventQueue("ln")); Boolean isKilled = Boolean.FALSE; try { - isKilled = (Boolean) inv2.getResult(); + isKilled = inv2.getResult(); } catch (Throwable e) { fail("Unexpected exception while killing a AsyncEventQueue"); } - AsyncInvocation inv3 = null; + AsyncInvocation inv3 = null; if (!isKilled) { inv3 = vm2.invokeAsync(() -> AsyncEventQueueTestBase.killSender("ln")); inv3.join(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/ParallelSerialAsyncEventListenerStopStartDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/ParallelSerialAsyncEventListenerStopStartDistributedTest.java index b43d76cc248c..ed7a60d364c9 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/ParallelSerialAsyncEventListenerStopStartDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/ParallelSerialAsyncEventListenerStopStartDistributedTest.java @@ -154,10 +154,10 @@ public void testStopStartPersistentParallelAndSerialAsyncEventQueues() { vm3.invoke(this::stopAsyncQueues); // Start all AEQs - AsyncInvocation startAeqsVm0 = vm0.invokeAsync(this::startAsyncQueues); - AsyncInvocation startAeqsVm1 = vm1.invokeAsync(this::startAsyncQueues); - AsyncInvocation startAeqsVm2 = vm2.invokeAsync(this::startAsyncQueues); - AsyncInvocation startAeqsVm3 = vm3.invokeAsync(this::startAsyncQueues); + AsyncInvocation startAeqsVm0 = vm0.invokeAsync(this::startAsyncQueues); + AsyncInvocation startAeqsVm1 = vm1.invokeAsync(this::startAsyncQueues); + AsyncInvocation startAeqsVm2 = vm2.invokeAsync(this::startAsyncQueues); + AsyncInvocation startAeqsVm3 = vm3.invokeAsync(this::startAsyncQueues); // Wait for async tasks to complete ThreadUtils.join(startAeqsVm0, 120 * 1000); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java index fd0f1235e636..e4d2cbb9e228 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentAsyncEventQueueDUnitTest.java @@ -163,11 +163,11 @@ public void testReplicatedSerialAsyncEventQueueWithMultipleDispatcherThreadsOrde vm4.invoke(() -> AsyncEventQueueTestBase .createReplicatedRegionWithAsyncEventQueue(getTestMethodName() + "_RR", "ln", isOffHeap())); - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm1.invokeAsync(() -> AsyncEventQueueTestBase.doPuts(getTestMethodName() + "_RR", 50)); - AsyncInvocation inv2 = vm1.invokeAsync( + AsyncInvocation inv2 = vm1.invokeAsync( () -> AsyncEventQueueTestBase.doNextPuts(getTestMethodName() + "_RR", 50, 100)); - AsyncInvocation inv3 = vm1.invokeAsync( + AsyncInvocation inv3 = vm1.invokeAsync( () -> AsyncEventQueueTestBase.doNextPuts(getTestMethodName() + "_RR", 100, 150)); try { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/IdleTimeOutDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/IdleTimeOutDUnitTest.java index ad68e92deb51..90416b6d14fd 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/IdleTimeOutDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/IdleTimeOutDUnitTest.java @@ -257,7 +257,7 @@ public void testIdleTimeOut() throws Throwable { Host host = Host.getHost(0); VM vm0 = host.getVM(0); vm0.invoke(IdleTimeOutDUnitTest::runTest1); - AsyncInvocation asyncObj = vm0.invokeAsync(IdleTimeOutDUnitTest::runTest2); + AsyncInvocation asyncObj = vm0.invokeAsync(IdleTimeOutDUnitTest::runTest2); ThreadUtils.join(asyncObj, 30 * 1000); if (asyncObj.exceptionOccurred()) { Assert.fail("asyncObj failed", asyncObj.getException()); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/LoginTimeOutDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/LoginTimeOutDUnitTest.java index 694017b67ba5..c475ba7b268d 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/LoginTimeOutDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/LoginTimeOutDUnitTest.java @@ -243,8 +243,8 @@ public final void preTearDown() throws Exception { public void testLoginTimeOut() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); - AsyncInvocation test1 = vm0.invokeAsync(LoginTimeOutDUnitTest::runTest1); - AsyncInvocation test2 = vm0.invokeAsync(LoginTimeOutDUnitTest::runTest2); + AsyncInvocation test1 = vm0.invokeAsync(LoginTimeOutDUnitTest::runTest1); + AsyncInvocation test2 = vm0.invokeAsync(LoginTimeOutDUnitTest::runTest2); ThreadUtils.join(test2, 120 * 1000); if (test2.exceptionOccurred()) { Assert.fail("asyncObj failed", test2.getException()); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/MaxPoolSizeDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/MaxPoolSizeDUnitTest.java index 3ddf0f01fc35..b7dce727968c 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/MaxPoolSizeDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/MaxPoolSizeDUnitTest.java @@ -247,7 +247,7 @@ public final void preTearDown() throws Exception { public void testMaxPoolSize() throws Exception { Host host = Host.getHost(0); VM vm0 = host.getVM(0); - AsyncInvocation asyncObj = vm0.invokeAsync(MaxPoolSizeDUnitTest::runTest1); + AsyncInvocation asyncObj = vm0.invokeAsync(MaxPoolSizeDUnitTest::runTest1); ThreadUtils.join(asyncObj, 30 * 1000); if (asyncObj.exceptionOccurred()) { Assert.fail("asyncObj failed", asyncObj.getException()); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TransactionTimeOutDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TransactionTimeOutDUnitTest.java index 644f8cd6d882..4b4e2d76c931 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TransactionTimeOutDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TransactionTimeOutDUnitTest.java @@ -117,8 +117,8 @@ public final void preTearDown() { public void testTimeOut() { Host host = Host.getHost(0); VM vm0 = host.getVM(0); - AsyncInvocation async1 = vm0.invokeAsync(this::userTransactionCanBeTimedOut); - AsyncInvocation async2 = vm0.invokeAsync(this::userTransactionCanBeTimedOut); + AsyncInvocation async1 = vm0.invokeAsync(this::userTransactionCanBeTimedOut); + AsyncInvocation async2 = vm0.invokeAsync(this::userTransactionCanBeTimedOut); ThreadUtils.join(async1, 30 * 1000); ThreadUtils.join(async2, 30 * 1000); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java index c00721a39d88..6abb744f20e9 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnManagerMultiThreadDUnitTest.java @@ -386,7 +386,7 @@ public static void getNumberOfRows() { @Test public void test1AllCommit() throws Exception { VM vm0 = Host.getHost(0).getVM(0); - AsyncInvocation asyncObj1 = + AsyncInvocation asyncObj1 = vm0.invokeAsync(TxnManagerMultiThreadDUnitTest::callCommitThreads); ThreadUtils.join(asyncObj1, 30 * 1000); if (asyncObj1.exceptionOccurred()) { @@ -419,7 +419,7 @@ public static void callCommitThreads() { @Test public void test3Commit2Rollback() throws Exception { VM vm0 = Host.getHost(0).getVM(0); - AsyncInvocation asyncObj1 = + AsyncInvocation asyncObj1 = vm0.invokeAsync(TxnManagerMultiThreadDUnitTest::callCommitandRollbackThreads); ThreadUtils.join(asyncObj1, 30 * 1000); if (asyncObj1.exceptionOccurred()) { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnTimeOutDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnTimeOutDUnitTest.java index 4dd5556b0457..38b4e432854c 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnTimeOutDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/jta/dunit/TxnTimeOutDUnitTest.java @@ -133,23 +133,23 @@ public void testMultiThreaded() throws Exception { Object[] o = new Object[1]; o[0] = 2; - AsyncInvocation asyncObj1 = vm0.invokeAsync(TxnTimeOutDUnitTest.class, "runTest3", o); + AsyncInvocation asyncObj1 = vm0.invokeAsync(TxnTimeOutDUnitTest.class, "runTest3", o); Object[] o1 = new Object[1]; o1[0] = 2; - AsyncInvocation asyncObj2 = vm0.invokeAsync(TxnTimeOutDUnitTest.class, "runTest3", o1); + AsyncInvocation asyncObj2 = vm0.invokeAsync(TxnTimeOutDUnitTest.class, "runTest3", o1); Object[] o2 = new Object[1]; o2[0] = 3; - AsyncInvocation asyncObj3 = vm0.invokeAsync(TxnTimeOutDUnitTest.class, "runTest3", o2); + AsyncInvocation asyncObj3 = vm0.invokeAsync(TxnTimeOutDUnitTest.class, "runTest3", o2); Object[] o3 = new Object[1]; o3[0] = 3; - AsyncInvocation asyncObj4 = vm0.invokeAsync(TxnTimeOutDUnitTest.class, "runTest3", o3); + AsyncInvocation asyncObj4 = vm0.invokeAsync(TxnTimeOutDUnitTest.class, "runTest3", o3); Object[] o4 = new Object[1]; o4[0] = 1; - AsyncInvocation asyncObj5 = vm0.invokeAsync(TxnTimeOutDUnitTest.class, "runTest3", o4); + AsyncInvocation asyncObj5 = vm0.invokeAsync(TxnTimeOutDUnitTest.class, "runTest3", o4); ThreadUtils.join(asyncObj1, 5 * 60 * 1000); if (asyncObj1.exceptionOccurred()) { @@ -187,8 +187,8 @@ public void testMultiThreaded() throws Exception { public void testLoginTimeOut() throws Throwable { Host host = Host.getHost(0); VM vm0 = host.getVM(0); - AsyncInvocation asyncObj1 = vm0.invokeAsync(TxnTimeOutDUnitTest::runTest2); - AsyncInvocation asyncObj2 = vm0.invokeAsync(TxnTimeOutDUnitTest::runTest1); + AsyncInvocation asyncObj1 = vm0.invokeAsync(TxnTimeOutDUnitTest::runTest2); + AsyncInvocation asyncObj2 = vm0.invokeAsync(TxnTimeOutDUnitTest::runTest1); ThreadUtils.join(asyncObj1, 5 * 60 * 1000); if (asyncObj1.exceptionOccurred()) { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/statistics/StatisticsDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/statistics/StatisticsDistributedTest.java index be077727671f..37e47a7e7a49 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/statistics/StatisticsDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/statistics/StatisticsDistributedTest.java @@ -231,7 +231,7 @@ public void testPubAndSubCustomStats() throws Exception { for (int i = 0; i < NUM_PUBS; i++) { final int pubVM = i; - AsyncInvocation[] publishers = new AsyncInvocation[NUM_PUB_THREADS]; + AsyncInvocation[] publishers = new AsyncInvocation[NUM_PUB_THREADS]; for (int j = 0; j < NUM_PUB_THREADS; j++) { final int pubThread = j; publishers[pubThread] = pubs[pubVM] @@ -290,7 +290,7 @@ public void testPubAndSubCustomStats() throws Exception { }); } - for (final AsyncInvocation publisher : publishers) { + for (final AsyncInvocation publisher : publishers) { publisher.join(); assertThat(publisher.exceptionOccurred()).isFalse(); } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/DiskManagementDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/DiskManagementDUnitTest.java index 129a43b3ff17..24e9335bfd75 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/management/DiskManagementDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/management/DiskManagementDUnitTest.java @@ -15,7 +15,6 @@ package org.apache.geode.management; import static java.util.concurrent.TimeUnit.MINUTES; -import static org.apache.geode.test.awaitility.GeodeAwaitility.await; import static org.assertj.core.api.Assertions.assertThat; import java.io.File; @@ -161,7 +160,7 @@ public void testMissingMembers() throws Exception { closeCache(memberVM2); - AsyncInvocation creatingPersistentRegionAsync = createPersistentRegionAsync(memberVM1); + AsyncInvocation creatingPersistentRegionAsync = createPersistentRegionAsync(memberVM1); memberVM1.invoke(() -> GeodeAwaitility.await().until(() -> { GemFireCacheImpl cache = (GemFireCacheImpl) managementTestRule.getCache(); @@ -182,7 +181,7 @@ public void testMissingMembers() throws Exception { assertThat(bean.revokeMissingDiskStores(missingDiskStores[0].getDiskStoreId())).isTrue(); }); - await(creatingPersistentRegionAsync); + creatingPersistentRegionAsync.await(2, MINUTES); verifyRecoveryStats(memberVM1, true); @@ -343,10 +342,10 @@ private void closeCache(final VM memberVM) { private void createPersistentRegion(final VM memberVM) throws InterruptedException, ExecutionException, TimeoutException { - await(createPersistentRegionAsync(memberVM)); + createPersistentRegionAsync(memberVM).await(2, MINUTES); } - private AsyncInvocation createPersistentRegionAsync(final VM memberVM) { + private AsyncInvocation createPersistentRegionAsync(final VM memberVM) { return memberVM.invokeAsync("createPersistentRegionAsync", () -> { File dir = new File(diskDir, String.valueOf(ProcessUtils.identifyPid())); @@ -393,10 +392,4 @@ private MemberMXBean awaitMemberMXBeanProxy(final DistributedMember member) { () -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull()); return service.getMBeanProxy(objectName, MemberMXBean.class); } - - private void await(final AsyncInvocation createPersistentRegionAsync) - throws InterruptedException, ExecutionException, TimeoutException { - createPersistentRegionAsync.await(2, MINUTES); - } - } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/MultiClientDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/MultiClientDUnitTest.java index d2b7bc84875d..7ef416e31cee 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/MultiClientDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/MultiClientDUnitTest.java @@ -98,7 +98,7 @@ public void multiClient() throws ExecutionException, InterruptedException, Timeo // client 3 keeps logging in, do some successful put, and log out and keep doing it for multiple // times - AsyncInvocation vm3Invoke = client3.invokeAsync("run as data", () -> { + AsyncInvocation vm3Invoke = client3.invokeAsync("run as data", () -> { ClientCache cache = ClusterStartupRule.getClientCache(); Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create("region"); for (int j = 0; j < KEY_COUNT; j++) { @@ -107,7 +107,7 @@ public void multiClient() throws ExecutionException, InterruptedException, Timeo }); // client 4 keeps logging in, do an unauthorized put, and log out - AsyncInvocation vm4Invoke = client4.invokeAsync("run as stranger", () -> { + AsyncInvocation vm4Invoke = client4.invokeAsync("run as stranger", () -> { ClientCache cache = ClusterStartupRule.getClientCache(); Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create("region"); for (int j = 0; j < KEY_COUNT; j++) { @@ -118,7 +118,7 @@ public void multiClient() throws ExecutionException, InterruptedException, Timeo }); // client 5 keeps logging in, do some successful get, and log out - AsyncInvocation vm5Invoke = client5.invokeAsync("run as data", () -> { + AsyncInvocation vm5Invoke = client5.invokeAsync("run as data", () -> { ClientCache cache = ClusterStartupRule.getClientCache(); Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create("region"); for (int j = 0; j < KEY_COUNT; j++) { @@ -127,7 +127,7 @@ public void multiClient() throws ExecutionException, InterruptedException, Timeo }); // // client 6 keeps logging in with incorrect - AsyncInvocation vm6Invoke = client6.invokeAsync("run as invalid user", () -> { + AsyncInvocation vm6Invoke = client6.invokeAsync("run as invalid user", () -> { ClientCache cache = ClusterStartupRule.getClientCache(); Region region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create("region"); for (int j = 0; j < 1; j++) { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/MultiGfshDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/MultiGfshDUnitTest.java index c122fece2490..35466cd27a54 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/MultiGfshDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/security/MultiGfshDUnitTest.java @@ -68,7 +68,7 @@ public void testMultiUser() throws Exception { VM vm2 = lsRule.getVM(2); // set up vm_2 as a gfsh vm, and then connect as "stranger" and try to execute the commands and // assert errors comes back are NotAuthorized - AsyncInvocation vm2Invoke = vm2.invokeAsync("run as guest", () -> { + AsyncInvocation vm2Invoke = vm2.invokeAsync("run as guest", () -> { GfshCommandRule gfsh = new GfshCommandRule(); gfsh.secureConnectAndVerify(jmxPort, PortType.jmxManager, "guest", "guest"); @@ -93,7 +93,7 @@ public void testMultiUser() throws Exception { // set up vm_3 as another gfsh vm, and then connect as "super-user" and try to execute the // commands and assert we don't get a NotAuthorized Exception VM vm3 = lsRule.getVM(3); - AsyncInvocation vm3Invoke = vm3.invokeAsync("run as superUser", () -> { + AsyncInvocation vm3Invoke = vm3.invokeAsync("run as superUser", () -> { GfshCommandRule gfsh = new GfshCommandRule(); gfsh.secureConnectAndVerify(jmxPort, PortType.jmxManager, "data,cluster", "data,cluster"); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/pdx/PdxSerializableDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/pdx/PdxSerializableDUnitTest.java index a016d27aac9b..6ac342d15950 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/pdx/PdxSerializableDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/pdx/PdxSerializableDUnitTest.java @@ -229,8 +229,8 @@ public Object call() throws Exception { // Now recreate the region, recoverying from disk - AsyncInvocation future1 = vm1.invokeAsync(createRegion); - AsyncInvocation future2 = vm2.invokeAsync(createRegion); + AsyncInvocation future1 = vm1.invokeAsync(createRegion); + AsyncInvocation future2 = vm2.invokeAsync(createRegion); future1.getResult(); future2.getResult(); @@ -311,7 +311,7 @@ public void beforeProcessMessage(ClusterDistributionManager dm, DistributionMess }); }); - AsyncInvocation async0 = vm0.invokeAsync("propagate value with new pdx enum type", () -> { + AsyncInvocation async0 = vm0.invokeAsync("propagate value with new pdx enum type", () -> { Cache cache = getCache(properties); final Region pdxRegion = cache.getRegion(PeerTypeRegistration.REGION_FULL_PATH); final DUnitBlackboard bb = getBlackboard(); @@ -343,7 +343,7 @@ public void run() { // vm0 has sent a new TestObject but vm1 does not have the enum type needed to // deserialize it. - AsyncInvocation async1 = vm1.invokeAsync("try to read object w/o enum type", () -> { + AsyncInvocation async1 = vm1.invokeAsync("try to read object w/o enum type", () -> { DUnitBlackboard bb = getBlackboard(); bb.waitForGate("pdxObjectPut", 10, TimeUnit.SECONDS); Region region = getCache(properties).getRegion("testRegion"); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/pdx/PdxTypeGenerationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/pdx/PdxTypeGenerationDUnitTest.java index acb6a164c69a..43985570d921 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/pdx/PdxTypeGenerationDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/pdx/PdxTypeGenerationDUnitTest.java @@ -93,12 +93,12 @@ public void definingNewTypeUpdatesLocalMapsAfterServerRestart() { public void testNoConflictsWhenGeneratingPdxTypesFromJSONOnMultipleServers() { int repeats = 10000; - AsyncInvocation invocation1 = server1.invokeAsync(() -> { + AsyncInvocation invocation1 = server1.invokeAsync(() -> { for (int i = 0; i < repeats; ++i) { JSONFormatter.fromJSON("{\"counter" + i + "\": " + i + "}"); } }); - AsyncInvocation invocation2 = server2.invokeAsync(() -> { + AsyncInvocation invocation2 = server2.invokeAsync(() -> { for (int i = 0; i < repeats; ++i) { JSONFormatter.fromJSON("{\"counter" + i + "\": " + i + "}"); } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/AuthExpirationMultiServerDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/AuthExpirationMultiServerDUnitTest.java index 31b56c2d17de..0a5477d30056 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/security/AuthExpirationMultiServerDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/security/AuthExpirationMultiServerDUnitTest.java @@ -339,7 +339,7 @@ public void putAll() throws Exception { c -> c.withProperty(SECURITY_CLIENT_AUTH_INIT, UpdatableUserAuthInitialize.class.getName()) .withPoolSubscription(true) .withLocatorConnection(locatorPort)); - AsyncInvocation invokePut = client.invokeAsync(() -> { + AsyncInvocation invokePut = client.invokeAsync(() -> { UpdatableUserAuthInitialize.setUser("user1"); Region proxyRegion = ClusterStartupRule.getClientCache() diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientContainsKeyAuthDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientContainsKeyAuthDUnitTest.java index 4b7f3c61f3b7..85c22cfa4014 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientContainsKeyAuthDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientContainsKeyAuthDUnitTest.java @@ -60,7 +60,7 @@ public void before() throws Exception { @Test public void testContainsKey() throws Exception { - AsyncInvocation ai1 = client1.invokeAsync(() -> { + AsyncInvocation ai1 = client1.invokeAsync(() -> { ClientCache cache = createClientCache("key1User", "1234567", server.getPort()); final Region region = createProxyRegion(cache, REGION_NAME); assertTrue(region.containsKeyOnServer("key1")); @@ -68,7 +68,7 @@ public void testContainsKey() throws Exception { "DATA:READ:AuthRegion:key3"); }); - AsyncInvocation ai2 = client2.invokeAsync(() -> { + AsyncInvocation ai2 = client2.invokeAsync(() -> { ClientCache cache = createClientCache("authRegionReader", "1234567", server.getPort()); final Region region = createProxyRegion(cache, REGION_NAME); region.containsKeyOnServer("key3"); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientGetEntryAuthDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientGetEntryAuthDUnitTest.java index e557d2a69413..712bcbbfcf50 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientGetEntryAuthDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientGetEntryAuthDUnitTest.java @@ -63,7 +63,7 @@ public void before() throws Exception { @Test public void testGetEntry() throws Exception { // client1 connects to server as a user not authorized to do any operations - AsyncInvocation ai1 = client1.invokeAsync(() -> { + AsyncInvocation ai1 = client1.invokeAsync(() -> { ClientCache cache = createClientCache("stranger", "1234567", server.getPort()); CacheTransactionManager transactionManager = cache.getCacheTransactionManager(); @@ -77,7 +77,7 @@ public void testGetEntry() throws Exception { }); - AsyncInvocation ai2 = client2.invokeAsync(() -> { + AsyncInvocation ai2 = client2.invokeAsync(() -> { ClientCache cache = createClientCache("authRegionReader", "1234567", server.getPort()); CacheTransactionManager transactionManager = cache.getCacheTransactionManager(); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientGetPutAuthDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientGetPutAuthDUnitTest.java index aee7152765ad..8ca77a6806ff 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientGetPutAuthDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientGetPutAuthDUnitTest.java @@ -78,7 +78,7 @@ public void testGetPutAuthorization() throws InterruptedException { keys.add("key2"); // client1 connects to server as a user not authorized to do any operations - AsyncInvocation ai1 = client1.invokeAsync(() -> { + AsyncInvocation ai1 = client1.invokeAsync(() -> { ClientCache cache = createClientCache("stranger", "1234567", server.getPort()); Region region = createProxyRegion(cache, REGION_NAME); @@ -97,7 +97,7 @@ public void testGetPutAuthorization() throws InterruptedException { // client2 connects to user as a user authorized to use AuthRegion region - AsyncInvocation ai2 = client2.invokeAsync(() -> { + AsyncInvocation ai2 = client2.invokeAsync(() -> { ClientCache cache = createClientCache("authRegionUser", "1234567", server.getPort()); Region region = createProxyRegion(cache, REGION_NAME); @@ -117,7 +117,7 @@ public void testGetPutAuthorization() throws InterruptedException { }); // client3 connects to user as a user authorized to use key1 in AuthRegion region - AsyncInvocation ai3 = client3.invokeAsync(() -> { + AsyncInvocation ai3 = client3.invokeAsync(() -> { ClientCache cache = createClientCache("key1User", "1234567", server.getPort()); Region region = createProxyRegion(cache, REGION_NAME); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientRegisterInterestAuthDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientRegisterInterestAuthDUnitTest.java index 0376d9b1e504..68febbfa3ba0 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientRegisterInterestAuthDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientRegisterInterestAuthDUnitTest.java @@ -63,7 +63,7 @@ public void testRegisterInterest() throws Exception { extraProperties.setProperty(SECURITY_CLIENT_DHALGO, "AES:128"); // client1 connects to server as a user not authorized to do any operations - AsyncInvocation ai1 = client1.invokeAsync(() -> { + AsyncInvocation ai1 = client1.invokeAsync(() -> { ClientCache cache = createClientCache("stranger", "1234567", server.getPort(), extraProperties); Region region = createProxyRegion(cache, REGION_NAME); @@ -71,7 +71,7 @@ public void testRegisterInterest() throws Exception { }); // client2 connects to user as a user authorized to use AuthRegion region - AsyncInvocation ai2 = client2.invokeAsync(() -> { + AsyncInvocation ai2 = client2.invokeAsync(() -> { ClientCache cache = createClientCache("authRegionUser", "1234567", server.getPort(), extraProperties); Region region = createProxyRegion(cache, REGION_NAME); @@ -79,7 +79,7 @@ public void testRegisterInterest() throws Exception { }); // client3 connects to user as a user authorized to use key1 in AuthRegion region - AsyncInvocation ai3 = client3.invokeAsync(() -> { + AsyncInvocation ai3 = client3.invokeAsync(() -> { ClientCache cache = createClientCache("key1User", "1234567", server.getPort(), extraProperties); Region region = createProxyRegion(cache, REGION_NAME); @@ -97,7 +97,7 @@ public void testRegisterInterestRegex() throws Exception { extraProperties.setProperty(SECURITY_CLIENT_DHALGO, "AES:128"); // client1 connects to server as a user not authorized to do any operations - AsyncInvocation ai1 = client1.invokeAsync(() -> { + AsyncInvocation ai1 = client1.invokeAsync(() -> { ClientCache cache = createClientCache("stranger", "1234567", server.getPort(), extraProperties); @@ -107,7 +107,7 @@ public void testRegisterInterestRegex() throws Exception { }); // client2 connects to user as a user authorized to use AuthRegion region - AsyncInvocation ai2 = client2.invokeAsync(() -> { + AsyncInvocation ai2 = client2.invokeAsync(() -> { ClientCache cache = createClientCache("authRegionUser", "1234567", server.getPort(), extraProperties); @@ -117,7 +117,7 @@ public void testRegisterInterestRegex() throws Exception { }); // client3 connects to user as a user authorized to use key1 in AuthRegion region - AsyncInvocation ai3 = client3.invokeAsync(() -> { + AsyncInvocation ai3 = client3.invokeAsync(() -> { ClientCache cache = createClientCache("key1User", "1234567", server.getPort(), extraProperties); @@ -142,7 +142,7 @@ public void testRegisterInterestList() throws Exception { keys.add("key2"); // client1 connects to server as a user not authorized to do any operations - AsyncInvocation ai1 = client1.invokeAsync(() -> { + AsyncInvocation ai1 = client1.invokeAsync(() -> { ClientCache cache = createClientCache("stranger", "1234567", server.getPort(), extraProperties); @@ -152,7 +152,7 @@ public void testRegisterInterestList() throws Exception { }); // client2 connects to user as a user authorized to use AuthRegion region - AsyncInvocation ai2 = client2.invokeAsync(() -> { + AsyncInvocation ai2 = client2.invokeAsync(() -> { ClientCache cache = createClientCache("authRegionUser", "1234567", server.getPort(), extraProperties); @@ -162,7 +162,7 @@ public void testRegisterInterestList() throws Exception { }); // client3 connects to user as a user authorized to use key1 in AuthRegion region - AsyncInvocation ai3 = client3.invokeAsync(() -> { + AsyncInvocation ai3 = client3.invokeAsync(() -> { ClientCache cache = createClientCache("key1User", "1234567", server.getPort(), extraProperties); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientRemoveAllAuthDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientRemoveAllAuthDUnitTest.java index b3c5af37223c..039160122513 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientRemoveAllAuthDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientRemoveAllAuthDUnitTest.java @@ -55,7 +55,7 @@ public class ClientRemoveAllAuthDUnitTest extends JUnit4DistributedTestCase { @Test public void testRemoveAll() throws Exception { - AsyncInvocation ai1 = client1.invokeAsync(() -> { + AsyncInvocation ai1 = client1.invokeAsync(() -> { ClientCache cache = createClientCache("authRegionReader", "1234567", server.getPort()); Region region = createProxyRegion(cache, REGION_NAME); @@ -63,7 +63,7 @@ public void testRemoveAll() throws Exception { "DATA:WRITE:AuthRegion"); }); - AsyncInvocation ai2 = client2.invokeAsync(() -> { + AsyncInvocation ai2 = client2.invokeAsync(() -> { ClientCache cache = createClientCache("authRegionWriter", "1234567", server.getPort()); Region region = createProxyRegion(cache, REGION_NAME); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientUnregisterInterestAuthDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientUnregisterInterestAuthDUnitTest.java index 530dd3de19fa..9cecef7e61c3 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/security/ClientUnregisterInterestAuthDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/security/ClientUnregisterInterestAuthDUnitTest.java @@ -51,7 +51,7 @@ public class ClientUnregisterInterestAuthDUnitTest extends JUnit4DistributedTest @Test public void testUnregisterInterest() throws Exception { // client2 connects to user as a user authorized to use AuthRegion region - AsyncInvocation ai1 = client2.invokeAsync(() -> { + AsyncInvocation ai1 = client2.invokeAsync(() -> { ClientCache cache = createClientCache("authRegionUser", "1234567", server.getPort()); Region region = createProxyRegion(cache, REGION_NAME); diff --git a/geode-core/src/upgradeTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java b/geode-core/src/upgradeTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java index ba0e355c422d..0cf346fc3338 100644 --- a/geode-core/src/upgradeTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java +++ b/geode-core/src/upgradeTest/java/org/apache/geode/ClusterCommunicationsDUnitTest.java @@ -181,7 +181,7 @@ public void applicationUseOfDLockWithNoAckCacheOps() throws Exception { DistributedLockService.create("testLockService", cache.getDistributedSystem()); distLockService.lock("myLock", 50000, 50000); }); - AsyncInvocation async = waitForTheLockAsync(dUnitBlackboard, true); + AsyncInvocation async = waitForTheLockAsync(dUnitBlackboard, true); for (int i = 0; i < 5; i++) { getVM(1).invoke("update cache and release lock in vm1", () -> { DistributedLockService distLockService = @@ -210,10 +210,11 @@ public void applicationUseOfDLockWithNoAckCacheOps() throws Exception { } @NotNull - private AsyncInvocation waitForTheLockAsync(DUnitBlackboard dUnitBlackboard, boolean initialWait) + private AsyncInvocation waitForTheLockAsync(DUnitBlackboard dUnitBlackboard, + boolean initialWait) throws Exception { dUnitBlackboard.clearGate("waitingForLock"); - AsyncInvocation async = getVM(2).invokeAsync("wait for the lock", () -> { + AsyncInvocation async = getVM(2).invokeAsync("wait for the lock", () -> { DistributedLockService distLockService = initialWait ? DistributedLockService.create("testLockService", cache.getDistributedSystem()) : DistributedLockService.getServiceNamed("testLockService"); diff --git a/geode-core/src/upgradeTest/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeConcurrentPutsReplicated.java b/geode-core/src/upgradeTest/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeConcurrentPutsReplicated.java index 26d6543ab772..88eda2ac350c 100644 --- a/geode-core/src/upgradeTest/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeConcurrentPutsReplicated.java +++ b/geode-core/src/upgradeTest/java/org/apache/geode/internal/cache/rollingupgrade/RollingUpgradeConcurrentPutsReplicated.java @@ -73,7 +73,7 @@ public void testConcurrentPutsReplicated() { invokeRunnableInVMs(invokeCreateRegion(regionName, shortcut), server1, server2); // async puts through server 2 - AsyncInvocation asyncPutsThroughOld = + AsyncInvocation asyncPutsThroughOld = server2.invokeAsync(new CacheSerializableRunnable("async puts") { @Override public void run2() { @@ -96,7 +96,7 @@ public void run2() { verifyValues(objectType, regionName, 0, 500, server1); // aync puts through server 1 - AsyncInvocation asyncPutsThroughNew = + AsyncInvocation asyncPutsThroughNew = server1.invokeAsync(new CacheSerializableRunnable("async puts") { @Override public void run2() { diff --git a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqDataDUnitTest.java b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqDataDUnitTest.java index 2996af5984ab..01d6c56e37cb 100644 --- a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqDataDUnitTest.java +++ b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqDataDUnitTest.java @@ -880,74 +880,75 @@ public void run2() throws CacheException { }); // Execute CQ while update is in progress. - AsyncInvocation processCqs = client.invokeAsync(new CacheSerializableRunnable("Execute CQ") { - @Override - public void run2() throws CacheException { - QueryService cqService = getCache().getQueryService(); - // Get CqQuery object. - CqQuery cq1 = cqService.getCq(cqName); - if (cq1 == null) { - fail("Failed to get CQ " + cqName); - } + AsyncInvocation processCqs = + client.invokeAsync(new CacheSerializableRunnable("Execute CQ") { + @Override + public void run2() throws CacheException { + QueryService cqService = getCache().getQueryService(); + // Get CqQuery object. + CqQuery cq1 = cqService.getCq(cqName); + if (cq1 == null) { + fail("Failed to get CQ " + cqName); + } - SelectResults cqResults = null; + SelectResults cqResults = null; - try { - cqResults = cq1.executeWithInitialResults(); - } catch (Exception ex) { - AssertionError err = new AssertionError("Failed to execute CQ " + cqName, ex); - throw err; - } + try { + cqResults = cq1.executeWithInitialResults(); + } catch (Exception ex) { + AssertionError err = new AssertionError("Failed to execute CQ " + cqName, ex); + throw err; + } - // getLogWriter().info("initial result size = " + cqResults.size()); + // getLogWriter().info("initial result size = " + cqResults.size()); - CqQueryTestListener cqListener = - (CqQueryTestListener) cq1.getCqAttributes().getCqListener(); - // Wait for the last key to arrive. - cqListener.waitForCreated("" + totalObjects); + CqQueryTestListener cqListener = + (CqQueryTestListener) cq1.getCqAttributes().getCqListener(); + // Wait for the last key to arrive. + cqListener.waitForCreated("" + totalObjects); - // Check if the events from CqListener are in order. - int oldId = 0; - for (Object cqEvent : cqListener.events.toArray()) { - int newId = new Integer(cqEvent.toString()); - if (oldId > newId) { - fail("Queued events for CQ Listener during execution with " - + "Initial results is not in the order in which they are created."); - } - oldId = newId; - } + // Check if the events from CqListener are in order. + int oldId = 0; + for (Object cqEvent : cqListener.events.toArray()) { + int newId = new Integer(cqEvent.toString()); + if (oldId > newId) { + fail("Queued events for CQ Listener during execution with " + + "Initial results is not in the order in which they are created."); + } + oldId = newId; + } - // Check if all the IDs are present as part of Select Results and CQ Events. - HashSet ids = new HashSet(cqListener.events); - for (Object o : cqResults.asList()) { - Struct s = (Struct) o; - ids.add(s.get("key")); - } + // Check if all the IDs are present as part of Select Results and CQ Events. + HashSet ids = new HashSet(cqListener.events); + for (Object o : cqResults.asList()) { + Struct s = (Struct) o; + ids.add(s.get("key")); + } - // Iterator iter = cqResults.asSet().iterator(); - // while (iter.hasNext()) { - // Portfolio p = (Portfolio)iter.next(); - // ids.add(p.getPk()); - // //getLogWriter().info("Result set value : " + p.getPk()); - // } - - HashSet missingIds = new HashSet(); - String key = ""; - for (int i = 1; i <= totalObjects; i++) { - key = "" + i; - if (!(ids.contains(key))) { - missingIds.add(key); - } - } + // Iterator iter = cqResults.asSet().iterator(); + // while (iter.hasNext()) { + // Portfolio p = (Portfolio)iter.next(); + // ids.add(p.getPk()); + // //getLogWriter().info("Result set value : " + p.getPk()); + // } - if (!missingIds.isEmpty()) { - fail("Missing Keys in either ResultSet or the Cq Event list. " - + " Missing keys : [size : " + missingIds.size() + "]" + missingIds - + " Ids in ResultSet and CQ Events :" + ids); - } + HashSet missingIds = new HashSet(); + String key = ""; + for (int i = 1; i <= totalObjects; i++) { + key = "" + i; + if (!(ids.contains(key))) { + missingIds.add(key); + } + } - } - }); + if (!missingIds.isEmpty()) { + fail("Missing Keys in either ResultSet or the Cq Event list. " + + " Missing keys : [size : " + missingIds.size() + "]" + missingIds + + " Ids in ResultSet and CQ Events :" + ids); + } + + } + }); // Keep updating region (async invocation). server.invokeAsync(new CacheSerializableRunnable("Update Region") { @@ -1040,7 +1041,7 @@ public void run2() throws CacheException { }); // the thread that validates all results and executes first - AsyncInvocation processCqs = + AsyncInvocation processCqs = client.invokeAsync(new CacheSerializableRunnable("Execute CQ first") { @Override public void run2() throws CacheException { diff --git a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java index 50cbf7ad65e4..570e30e921ff 100644 --- a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java +++ b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqDataUsingPoolDUnitTest.java @@ -742,7 +742,7 @@ public void run2() throws CacheException { client.invoke(setTestHook()); // Execute CQ while update is in progress. - AsyncInvocation executeCq = + AsyncInvocation executeCq = client.invokeAsync(new CacheSerializableRunnable("Execute CQ AsyncInvoke") { @Override public void run2() throws CacheException { diff --git a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqStateDUnitTest.java b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqStateDUnitTest.java index a2b0ac6cc0a8..4d6f0bdd22d3 100644 --- a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqStateDUnitTest.java +++ b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/CqStateDUnitTest.java @@ -76,7 +76,7 @@ public void testBug51222() throws Exception { createReplicatedRegion(serverB, regionName, null); startCacheServers(serverB); - AsyncInvocation async = executeCQ(client, cqName); + AsyncInvocation async = executeCQ(client, cqName); ThreadUtils.join(async, 10000); client.invoke(() -> { diff --git a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/PartitionedRegionTxDUnitTest.java b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/PartitionedRegionTxDUnitTest.java index 184d37f18f9a..a26fd30031ca 100644 --- a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/PartitionedRegionTxDUnitTest.java +++ b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/cq/dunit/PartitionedRegionTxDUnitTest.java @@ -98,7 +98,7 @@ public void verifyCqRegistrationWorksDuringTxCommit() throws Exception { client = clusterStartupRule.startClientVM(3, cacheRule -> cacheRule.withServerConnection(server2.getPort()).withPoolSubscription(true)); - AsyncInvocation serverAsync = server1.invokeAsync(() -> { + AsyncInvocation serverAsync = server1.invokeAsync(() -> { InternalCache cache = ClusterStartupRule.getCache(); TXManagerImpl txManager = (TXManagerImpl) cache.getCacheTransactionManager(); txManager.begin(); @@ -192,7 +192,7 @@ public void verifyInterestRegistrationWorksDuringTxCommit() throws Exception { client = clusterStartupRule.startClientVM(3, cacheRule -> cacheRule.withServerConnection(server2.getPort()).withPoolSubscription(true)); - AsyncInvocation serverAsync = server1.invokeAsync(() -> { + AsyncInvocation serverAsync = server1.invokeAsync(() -> { InternalCache cache = ClusterStartupRule.getCache(); TXManagerImpl txManager = (TXManagerImpl) cache.getCacheTransactionManager(); txManager.begin(); diff --git a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryMonitorDUnitTest.java b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryMonitorDUnitTest.java index 9f185f30962f..2bd3908671fd 100644 --- a/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryMonitorDUnitTest.java +++ b/geode-cq/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryMonitorDUnitTest.java @@ -325,20 +325,20 @@ public void testCacheOpAfterQueryCancel() throws Exception { populateRegion(100, 1000); }); - AsyncInvocation ai1 = server1.invokeAsync(() -> { + AsyncInvocation ai1 = server1.invokeAsync(() -> { for (int j = 0; j < 5; j++) { populateRegion(0, 2000); } }); - AsyncInvocation ai2 = server2.invokeAsync(() -> { + AsyncInvocation ai2 = server2.invokeAsync(() -> { for (int j = 0; j < 5; j++) { populateRegion(1000, 3000); } }); // server3 performs a region put after a query is canceled. - AsyncInvocation ai3 = server3.invokeAsync(() -> { + AsyncInvocation ai3 = server3.invokeAsync(() -> { Region exampleRegion = ClusterStartupRule.getCache().getRegion("exampleRegion"); QueryService queryService = GemFireCacheImpl.getInstance().getQueryService(); String qStr = diff --git a/geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/examples/AsyncInvokeRunnableExampleTest.java b/geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/examples/AsyncInvokeRunnableExampleTest.java index 02fae7d5a5e2..68dc26ea2903 100644 --- a/geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/examples/AsyncInvokeRunnableExampleTest.java +++ b/geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/examples/AsyncInvokeRunnableExampleTest.java @@ -40,13 +40,13 @@ public void invokeAsyncHelloWorldInEachVM() { @Test public void invokeAsyncHelloWorldInEachVMWithAwait() throws Exception { - List invocations = new ArrayList<>(); + List> invocations = new ArrayList<>(); for (VM vm : getAllVMs()) { - AsyncInvocation invocation = + AsyncInvocation invocation = vm.invokeAsync(() -> System.out.println(vm + " says Hello World!")); invocations.add(invocation); } - for (AsyncInvocation invocation : invocations) { + for (AsyncInvocation invocation : invocations) { invocation.await(); } } diff --git a/geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/tests/BasicDistributedTest.java b/geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/tests/BasicDistributedTest.java index d16bca41a4d0..3d88f3371ae8 100644 --- a/geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/tests/BasicDistributedTest.java +++ b/geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/tests/BasicDistributedTest.java @@ -81,15 +81,17 @@ public void testInvokeOnObjectTargetWithEmptyArgs() { @Test public void testInvokeAsyncOnClassTargetWithEmptyArgs() throws Exception { - AsyncInvocation async = - vm0.invokeAsync(BasicDistributedTest.class, "booleanValue", new Object[] {}).join(); + AsyncInvocation async = + vm0.invokeAsync(BasicDistributedTest.class, "booleanValue", new Object[] {}) + .await(); assertThat(async.getResult(), is(true)); } @Test public void testInvokeAsyncOnObjectTargetWithEmptyArgs() throws Exception { - AsyncInvocation async = - vm0.invokeAsync(new BasicDistributedTest(), "booleanValue", new Object[] {}).join(); + AsyncInvocation async = + vm0.invokeAsync(new BasicDistributedTest(), "booleanValue", new Object[] {}) + .await(); assertThat(async.getResult(), is(true)); } @@ -105,15 +107,15 @@ public void testInvokeOnObjectTargetWithNullArgs() { @Test public void testInvokeAsyncOnClassTargetWithNullArgs() throws Exception { - AsyncInvocation async = - vm0.invokeAsync(BasicDistributedTest.class, "booleanValue", null).join(); + AsyncInvocation async = + vm0.invokeAsync(BasicDistributedTest.class, "booleanValue", null).await(); assertThat(async.getResult(), is(true)); } @Test public void testInvokeAsyncOnObjectTargetWithNullArgs() throws Exception { - AsyncInvocation async = - vm0.invokeAsync(new BasicDistributedTest(), "booleanValue", null).join(); + AsyncInvocation async = + vm0.invokeAsync(new BasicDistributedTest(), "booleanValue", null).await(); assertThat(async.getResult(), is(true)); } @@ -154,21 +156,23 @@ public void testRemoteInvokeAsync() throws Exception { String name = getUniqueName(); String value = "Hello"; - AsyncInvocation async1 = vm0.invokeAsync(() -> remoteBind(name, value)).join().checkException(); - AsyncInvocation async2 = - vm0.invokeAsync(() -> remoteValidateBind(name, value)).join().checkException(); - async1.join(); - async2.join(); + AsyncInvocation async1 = + vm0.invokeAsync(() -> remoteBind(name, value)).await(); + AsyncInvocation async2 = + vm0.invokeAsync(() -> remoteValidateBind(name, value)).await(); + async1.await(); + async2.await(); } @Test public void testRemoteInvokeAsyncWithException() throws Exception { - AsyncInvocation async = vm0.invokeAsync(BasicDistributedTest::remoteThrowException).join(); + AsyncInvocation async = + vm0.invokeAsync(BasicDistributedTest::remoteThrowException).join(); assertThat(async.exceptionOccurred(), is(true)); assertThat(async.getException(), instanceOf(BasicTestException.class)); - Throwable thrown = catchThrowable(async::checkException); + Throwable thrown = catchThrowable(async::await); assertThat(thrown, instanceOf(AssertionError.class)); assertThat(thrown.getCause(), notNullValue()); @@ -180,8 +184,7 @@ public void testRemoteInvokeAsyncWithException() throws Exception { public void testInvokeNamedRunnableLambdaAsync() throws Exception { Throwable thrown = catchThrowable( - () -> vm0.invokeAsync("throwSomething", BasicDistributedTest::throwException).join() - .checkException()); + () -> vm0.invokeAsync("throwSomething", BasicDistributedTest::throwException).await()); assertThat(thrown, notNullValue()); assertThat(thrown.getCause(), notNullValue()); diff --git a/geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/tests/VMDistributedTest.java b/geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/tests/VMDistributedTest.java index deb0b249d378..2e360ccb7a43 100644 --- a/geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/tests/VMDistributedTest.java +++ b/geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/tests/VMDistributedTest.java @@ -89,13 +89,13 @@ public void testReturnValue() throws Exception { final Host host = Host.getHost(0); final VM vm = host.getVM(0); // Assert class static invocation works - AsyncInvocation a1 = vm.invokeAsync(VMDistributedTest::getAndIncStaticCount); + AsyncInvocation a1 = vm.invokeAsync(VMDistributedTest::getAndIncStaticCount); a1.join(); - assertEquals(0, a1.getReturnValue()); + assertEquals(0, (long) a1.getReturnValue()); // Assert class static invocation with args works a1 = vm.invokeAsync(() -> incrementStaticCount(2)); a1.join(); - assertEquals(3, a1.getReturnValue()); + assertEquals(3, (long) a1.getReturnValue()); // Assert that previous values are not returned when invoking method w/ no return val a1 = vm.invokeAsync(VMDistributedTest::incStaticCount); a1.join(); @@ -103,13 +103,13 @@ public void testReturnValue() throws Exception { // Assert that previous null returns are over-written a1 = vm.invokeAsync(VMDistributedTest::getAndIncStaticCount); a1.join(); - assertEquals(4, a1.getReturnValue()); + assertEquals(4, (long) a1.getReturnValue()); // Assert object method invocation works with zero arg method final VMTestObject o = new VMTestObject(0); a1 = vm.invokeAsync(o, "incrementAndGet", new Object[] {}); a1.join(); - assertEquals(1, a1.getReturnValue()); + assertEquals(1, (long) a1.getReturnValue()); // Assert object method invocation works with no return a1 = vm.invokeAsync(o, "set", new Object[] {3}); a1.join(); diff --git a/geode-dunit/src/main/java/org/apache/geode/cache/query/dunit/HelperTestCase.java b/geode-dunit/src/main/java/org/apache/geode/cache/query/dunit/HelperTestCase.java index 29e2c357c54e..cdc01d33689c 100644 --- a/geode-dunit/src/main/java/org/apache/geode/cache/query/dunit/HelperTestCase.java +++ b/geode-dunit/src/main/java/org/apache/geode/cache/query/dunit/HelperTestCase.java @@ -189,7 +189,7 @@ public void onError(CqEvent aCqEvent) {} return cqa; } - protected AsyncInvocation executeCQ(VM vm, final String cqName) { + protected AsyncInvocation executeCQ(VM vm, final String cqName) { return vm.invokeAsync(new SerializableCallable() { @Override public Object call() throws CqException, RegionNotFoundException { diff --git a/geode-dunit/src/main/java/org/apache/geode/cache30/MultiVMRegionTestCase.java b/geode-dunit/src/main/java/org/apache/geode/cache30/MultiVMRegionTestCase.java index d3418b1ca2cf..75a5147c0474 100644 --- a/geode-dunit/src/main/java/org/apache/geode/cache30/MultiVMRegionTestCase.java +++ b/geode-dunit/src/main/java/org/apache/geode/cache30/MultiVMRegionTestCase.java @@ -457,7 +457,7 @@ public void afterUpdate(EntryEvent event) { flushIfNecessary(region); }); - AsyncInvocation verify = vm1.invokeAsync("Verify", () -> { + AsyncInvocation verify = vm1.invokeAsync("Verify", () -> { Region region = getRootRegion().getSubregion(regionName); @SuppressWarnings("unchecked") BlockingQueue queue = (BlockingQueue) region.getUserAttribute(); @@ -471,7 +471,7 @@ public void afterUpdate(EntryEvent event) { } }); - AsyncInvocation populate = vm0.invokeAsync("Populate", () -> { + AsyncInvocation populate = vm0.invokeAsync("Populate", () -> { Region region = getRootRegion().getSubregion(regionName); for (int i = 0; i <= lastValue; i++) { region.put(key, i); @@ -3240,7 +3240,7 @@ public void testNonblockingGetInitialImage() throws InterruptedException { }); // start asynchronous process that does updates to the data - AsyncInvocation async = + AsyncInvocation async = vm0.invokeAsync("Do Nonblocking Operations", () -> { Region region = getRootRegion().getSubregion(name); @@ -3356,7 +3356,7 @@ public void run2() throws CacheException { } }; - AsyncInvocation asyncGII = vm2.invokeAsync("Create Mirrored Region", create); + AsyncInvocation asyncGII = vm2.invokeAsync("Create Mirrored Region", create); if (!getRegionAttributes().getScope().isGlobal()) { // wait for nonblocking operations to complete @@ -3495,7 +3495,7 @@ public void run2() throws CacheException { }); // start asynchronous process that does updates to the data - AsyncInvocation async = + AsyncInvocation async = vm0.invokeAsync("Do Nonblocking Operations", new CacheSerializableRunnable() { @Override public void run2() throws CacheException { @@ -3589,7 +3589,7 @@ public void run() { }); } - AsyncInvocation asyncGII = vm2.invokeAsync(create); + AsyncInvocation asyncGII = vm2.invokeAsync(create); if (!getRegionAttributes().getScope().isGlobal()) { // wait for nonblocking operations to complete @@ -5870,8 +5870,8 @@ public void run() { } }; - AsyncInvocation a0 = vm0.invokeAsync("perform concurrent ops", performOps); - AsyncInvocation a1 = vm1.invokeAsync("perform concurrent ops", performOps); + AsyncInvocation a0 = vm0.invokeAsync("perform concurrent ops", performOps); + AsyncInvocation a1 = vm1.invokeAsync("perform concurrent ops", performOps); vm2.invoke(createRegion); @@ -5975,7 +5975,7 @@ private RegionVersionVector> getVersionVector(VM vm) throws Exc return DataSerializer.readObject(dis); } - private AsyncInvocation performOps4ClearWithConcurrentEvents(VM vm) { + private AsyncInvocation performOps4ClearWithConcurrentEvents(VM vm) { return vm.invokeAsync("perform concurrent ops", () -> { try { doOpsLoop(true); @@ -6010,8 +6010,8 @@ private void versionTestClearWithConcurrentEvents(boolean syncDiskWrite) { createRegionWithAttribute(vm0, name, syncDiskWrite); createRegionWithAttribute(vm1, name, syncDiskWrite); - AsyncInvocation a0 = performOps4ClearWithConcurrentEvents(vm0); - AsyncInvocation a1 = performOps4ClearWithConcurrentEvents(vm1); + AsyncInvocation a0 = performOps4ClearWithConcurrentEvents(vm0); + AsyncInvocation a1 = performOps4ClearWithConcurrentEvents(vm1); try { Thread.sleep(500); @@ -6062,14 +6062,14 @@ protected void versionTestClearOnNonReplicateWithConcurrentEvents() { }); - AsyncInvocation a0 = vm0.invokeAsync("perform concurrent ops", () -> { + AsyncInvocation a0 = vm0.invokeAsync("perform concurrent ops", () -> { doOpsLoop(true); if (CCRegion.getScope().isDistributedNoAck()) { sendSerialMessageToAll(); // flush the ops } }); - AsyncInvocation a1 = vm1.invokeAsync("perform concurrent ops", () -> { + AsyncInvocation a1 = vm1.invokeAsync("perform concurrent ops", () -> { doOpsLoop(true); if (CCRegion.getScope().isDistributedNoAck()) { @@ -6411,8 +6411,8 @@ public void run() { } }; - AsyncInvocation a0 = vm0.invokeAsync("perform concurrent ops", performOps); - AsyncInvocation a1 = vm1.invokeAsync("perform concurrent ops", performOps); + AsyncInvocation a0 = vm0.invokeAsync("perform concurrent ops", performOps); + AsyncInvocation a1 = vm1.invokeAsync("perform concurrent ops", performOps); // try { // Thread.sleep(500); @@ -6677,7 +6677,7 @@ protected void versionTestGetAllWithVersions() { }); } - boolean waitForAsyncProcessing(AsyncInvocation async, String expectedError) { + boolean waitForAsyncProcessing(AsyncInvocation async, String expectedError) { try { async.await(); } catch (Throwable e) { diff --git a/geode-dunit/src/main/java/org/apache/geode/test/junit/rules/VMProvider.java b/geode-dunit/src/main/java/org/apache/geode/test/junit/rules/VMProvider.java index a96248012d7e..b319bfd84069 100644 --- a/geode-dunit/src/main/java/org/apache/geode/test/junit/rules/VMProvider.java +++ b/geode-dunit/src/main/java/org/apache/geode/test/junit/rules/VMProvider.java @@ -112,21 +112,19 @@ public AsyncInvocation invokeAsync(final SerializableCallableIF callab return getVM().invokeAsync(callable); } - public AsyncInvocation invokeAsync(String name, final SerializableCallableIF callable) { return getVM().invokeAsync(name, callable); } - public AsyncInvocation invokeAsync(final SerializableRunnableIF runnable) { + public AsyncInvocation invokeAsync(final SerializableRunnableIF runnable) { return getVM().invokeAsync(runnable); } - public AsyncInvocation invokeAsync(String name, final SerializableRunnableIF runnable) { + public AsyncInvocation invokeAsync(String name, final SerializableRunnableIF runnable) { return getVM().invokeAsync(name, runnable); } public File getWorkingDir() { return getVM().getWorkingDirectory(); } - } diff --git a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneIndexCreationDUnitTest.java b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneIndexCreationDUnitTest.java index 45baa11d1fd2..556c8448366e 100644 --- a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneIndexCreationDUnitTest.java +++ b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneIndexCreationDUnitTest.java @@ -319,11 +319,11 @@ public void creatingIndexAfterRegionInTwoMembersSucceed(RegionTestableType regio regionType.createDataStore(getCache(), REGION_NAME); }); - AsyncInvocation createIndex1 = dataStore1.invokeAsync(() -> { + AsyncInvocation createIndex1 = dataStore1.invokeAsync(() -> { createIndexAfterRegion("field1"); }); - AsyncInvocation createIndex2 = dataStore2.invokeAsync(() -> { + AsyncInvocation createIndex2 = dataStore2.invokeAsync(() -> { createIndexAfterRegion("field1"); }); diff --git a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneIndexDestroyDUnitTest.java b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneIndexDestroyDUnitTest.java index d83fce590797..a61b6bbd1eaf 100644 --- a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneIndexDestroyDUnitTest.java +++ b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneIndexDestroyDUnitTest.java @@ -195,7 +195,7 @@ public void verifyDestroySingleIndexWhileDoingPuts(RegionTestableType regionType dataStore2.invoke(this::verifyIndexCreated); // Start puts - AsyncInvocation putter = dataStore1.invokeAsync(this::doPutsUntilStopped); + AsyncInvocation putter = dataStore1.invokeAsync(this::doPutsUntilStopped); // Wait until puts have started dataStore1.invoke(this::waitUntilPutsHaveStarted); @@ -236,7 +236,7 @@ public void verifyDestroyAllIndexesWhileDoingPuts(RegionTestableType regionType) dataStore2.invoke(this::verifyIndexesCreated); // Start puts - AsyncInvocation putter = dataStore1.invokeAsync(this::doPutsUntilStopped); + AsyncInvocation putter = dataStore1.invokeAsync(this::doPutsUntilStopped); // Wait until puts have started dataStore1.invoke(this::waitUntilPutsHaveStarted); @@ -284,7 +284,7 @@ public void verifyDestroySingleIndexWhileDoingQueries(RegionTestableType regionT accessor.invoke(() -> waitUntilFlushed(INDEX_NAME)); // Start queries - AsyncInvocation querier = accessor + AsyncInvocation querier = accessor .invokeAsync(() -> doQueriesUntilException(INDEX_NAME, "field1Value", "field1", numPuts)); // Wait until queries have started @@ -329,7 +329,7 @@ public void verifyDestroyAllIndexesWhileDoingQueries(RegionTestableType regionTy accessor.invoke(() -> waitUntilFlushed(INDEX2_NAME)); // Start queries - AsyncInvocation querier = accessor + AsyncInvocation querier = accessor .invokeAsync(() -> doQueriesUntilException(INDEX1_NAME, "field1Value", "field1", numPuts)); // Wait until queries have started diff --git a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneQueriesReindexDUnitTest.java b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneQueriesReindexDUnitTest.java index 1fdad323452b..6baa8236a4fc 100644 --- a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneQueriesReindexDUnitTest.java +++ b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneQueriesReindexDUnitTest.java @@ -80,11 +80,11 @@ public void dropAndRecreateIndex(RegionTestableType regionTestType) throws Excep dataStore1.invoke(this::destroyIndex); // re-index stored data - AsyncInvocation ai1 = dataStore1.invokeAsync(() -> { + AsyncInvocation ai1 = dataStore1.invokeAsync(() -> { createIndex("text"); }); - AsyncInvocation ai2 = dataStore2.invokeAsync(() -> { + AsyncInvocation ai2 = dataStore2.invokeAsync(() -> { createIndex("text"); }); @@ -115,15 +115,15 @@ public void afterReindexingWeShouldBeAbleToGetTheStatusOfIndexingProgress( putDataInRegion(accessor); // re-index stored data - AsyncInvocation ai1 = dataStore1.invokeAsync(() -> { + AsyncInvocation ai1 = dataStore1.invokeAsync(() -> { createIndex("text"); }); - AsyncInvocation ai2 = dataStore2.invokeAsync(() -> { + AsyncInvocation ai2 = dataStore2.invokeAsync(() -> { createIndex("text"); }); - AsyncInvocation ai3 = accessor.invokeAsync(() -> { + AsyncInvocation ai3 = accessor.invokeAsync(() -> { if (regionTestType != PARTITION_WITH_CLIENT) { createIndex("text"); } @@ -208,29 +208,29 @@ public void recreateDifferentIndexesWithDifferentFieldsShouldPass( putDataInRegion(accessor); // re-index stored data - AsyncInvocation ai1 = dataStore1.invokeAsync(() -> { + AsyncInvocation ai1 = dataStore1.invokeAsync(() -> { createIndex("text"); }); - AsyncInvocation ai2 = dataStore2.invokeAsync(() -> { + AsyncInvocation ai2 = dataStore2.invokeAsync(() -> { createIndex(INDEX_NAME + "2", "text2"); }); - AsyncInvocation ai3 = dataStore1.invokeAsync(() -> { + AsyncInvocation ai3 = dataStore1.invokeAsync(() -> { createIndex(INDEX_NAME + "2", "text2"); }); - AsyncInvocation ai4 = dataStore2.invokeAsync(() -> { + AsyncInvocation ai4 = dataStore2.invokeAsync(() -> { createIndex("text"); }); - AsyncInvocation ai5 = accessor.invokeAsync(() -> { + AsyncInvocation ai5 = accessor.invokeAsync(() -> { if (getCache().getRegion(REGION_NAME) instanceof PartitionedRegion) { createIndex(INDEX_NAME + "1", "text"); } }); - AsyncInvocation ai6 = accessor.invokeAsync(() -> { + AsyncInvocation ai6 = accessor.invokeAsync(() -> { if (getCache().getRegion(REGION_NAME) instanceof PartitionedRegion) { createIndex(INDEX_NAME + "2", "text2"); } @@ -255,11 +255,11 @@ public void recreateDifferentIndexesWithDifferentFieldsShouldPass( } private void verifyCreateIndexWithDifferentFieldShouldFail() throws Exception { - AsyncInvocation ai1 = dataStore1.invokeAsync(() -> { + AsyncInvocation ai1 = dataStore1.invokeAsync(() -> { createIndex("text"); }); - AsyncInvocation ai2 = dataStore2.invokeAsync(() -> { + AsyncInvocation ai2 = dataStore2.invokeAsync(() -> { createIndex("text2"); }); @@ -309,12 +309,12 @@ public void reindexThenQuery(RegionTestableType regionTestType) throws Exception putDataInRegion(accessor); // re-index stored data - AsyncInvocation ai1 = dataStore1.invokeAsync(() -> { + AsyncInvocation ai1 = dataStore1.invokeAsync(() -> { createIndex("text"); }); // re-index stored data - AsyncInvocation ai2 = dataStore2.invokeAsync(() -> { + AsyncInvocation ai2 = dataStore2.invokeAsync(() -> { createIndex("text"); }); diff --git a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneQueriesWithRegionCreatedBeforeReindexClientDUnitTest.java b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneQueriesWithRegionCreatedBeforeReindexClientDUnitTest.java index 250751a27d37..0e9e43a9852d 100644 --- a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneQueriesWithRegionCreatedBeforeReindexClientDUnitTest.java +++ b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneQueriesWithRegionCreatedBeforeReindexClientDUnitTest.java @@ -52,10 +52,10 @@ protected void createRegionAndIndexForAllDataStores(RegionTestableType regionTes accessor.invoke(() -> initAccessor(regionTestType)); // re-index stored data - AsyncInvocation ai1 = dataStore1.invokeAsync(createIndex); + AsyncInvocation ai1 = dataStore1.invokeAsync(createIndex); // re-index stored data - AsyncInvocation ai2 = dataStore2.invokeAsync(createIndex); + AsyncInvocation ai2 = dataStore2.invokeAsync(createIndex); ai1.join(); ai2.join(); diff --git a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneQueriesWithRegionCreatedBeforeReindexDUnitTest.java b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneQueriesWithRegionCreatedBeforeReindexDUnitTest.java index 272fec35285c..2e5c3a69b198 100644 --- a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneQueriesWithRegionCreatedBeforeReindexDUnitTest.java +++ b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/LuceneQueriesWithRegionCreatedBeforeReindexDUnitTest.java @@ -60,9 +60,9 @@ protected void createRegionAndIndexForAllDataStores(RegionTestableType regionTes accessor.invoke(() -> initAccessor(regionTestType)); // re-index stored data - AsyncInvocation ai1 = dataStore1.invokeAsync(createIndex); - AsyncInvocation ai2 = dataStore2.invokeAsync(createIndex); - AsyncInvocation ai3 = accessor.invokeAsync(createIndex); + AsyncInvocation ai1 = dataStore1.invokeAsync(createIndex); + AsyncInvocation ai2 = dataStore2.invokeAsync(createIndex); + AsyncInvocation ai3 = accessor.invokeAsync(createIndex); ai1.join(); ai2.join(); diff --git a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/RebalanceWithRedundancyWithRegionCreatedBeforeReindexDUnitTest.java b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/RebalanceWithRedundancyWithRegionCreatedBeforeReindexDUnitTest.java index c590d75a9b74..62e40cdc1a79 100644 --- a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/RebalanceWithRedundancyWithRegionCreatedBeforeReindexDUnitTest.java +++ b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/RebalanceWithRedundancyWithRegionCreatedBeforeReindexDUnitTest.java @@ -134,19 +134,19 @@ protected void createIndexAndRebalance(RegionTestableType regionTestType, // dataStore4.invoke(() -> (createIndex)); dataStore4.invoke(() -> initDataStore(regionTestType)); - AsyncInvocation aiRebalancer = dataStore1.invokeAsync(rebalance); + AsyncInvocation aiRebalancer = dataStore1.invokeAsync(rebalance); if (doOps) { - AsyncInvocation aiConcOps = dataStore1.invokeAsync(doConcOps); + AsyncInvocation aiConcOps = dataStore1.invokeAsync(doConcOps); aiConcOps.join(); aiConcOps.checkException(); } // re-index stored data - AsyncInvocation ai1 = dataStore1.invokeAsync(createIndex); - AsyncInvocation ai2 = dataStore2.invokeAsync(createIndex); - AsyncInvocation ai3 = dataStore3.invokeAsync(createIndex); - AsyncInvocation ai4 = dataStore4.invokeAsync(createIndex); + AsyncInvocation ai1 = dataStore1.invokeAsync(createIndex); + AsyncInvocation ai2 = dataStore2.invokeAsync(createIndex); + AsyncInvocation ai3 = dataStore3.invokeAsync(createIndex); + AsyncInvocation ai4 = dataStore4.invokeAsync(createIndex); aiRebalancer.join(); aiRebalancer.checkException(); diff --git a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/internal/cli/DestroyLuceneIndexCommandsDUnitTest.java b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/internal/cli/DestroyLuceneIndexCommandsDUnitTest.java index a94f61fd2b78..bbccb1ae488b 100644 --- a/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/internal/cli/DestroyLuceneIndexCommandsDUnitTest.java +++ b/geode-lucene/src/distributedTest/java/org/apache/geode/cache/lucene/internal/cli/DestroyLuceneIndexCommandsDUnitTest.java @@ -158,8 +158,8 @@ public void testDestroyIndexWithRegionCreationInProgress() throws Exception { // to be invoked which will wait for the index to be destroyed before invoking the real // afterDataRegionCreated method and completing region creation. The registerIndex method will // realize the defined index has been destroyed and destroy the real one. - AsyncInvocation server1RegionCreationInvocation = server1.invokeAsync(this::createRegion); - AsyncInvocation server2RegionCreationInvocation = server2.invokeAsync(this::createRegion); + AsyncInvocation server1RegionCreationInvocation = server1.invokeAsync(this::createRegion); + AsyncInvocation server2RegionCreationInvocation = server2.invokeAsync(this::createRegion); // Wait for index creation to be in progress server1.invoke(this::waitForIndexCreationInProgress); @@ -315,8 +315,8 @@ public void testDestroyIndexesWithRegionCreationInProgress() throws Exception { // to be invoked which will wait for the indexes to be destroyed before invoking the real // afterDataRegionCreated method and completing region creation. The registerIndex method will // realize the defined index has been destroyed and destroy the real one. - AsyncInvocation server1RegionCreationInvocation = server1.invokeAsync(this::createRegion); - AsyncInvocation server2RegionCreationInvocation = server2.invokeAsync(this::createRegion); + AsyncInvocation server1RegionCreationInvocation = server1.invokeAsync(this::createRegion); + AsyncInvocation server2RegionCreationInvocation = server2.invokeAsync(this::createRegion); // Wait for index creation to be in progress server1.invoke(this::waitForIndexCreationInProgress); diff --git a/geode-lucene/src/upgradeTest/java/org/apache/geode/cache/lucene/RollingUpgradeReindexShouldBeSuccessfulWhenAllServersRollToCurrentVersion.java b/geode-lucene/src/upgradeTest/java/org/apache/geode/cache/lucene/RollingUpgradeReindexShouldBeSuccessfulWhenAllServersRollToCurrentVersion.java index 50512ed5951b..07bb97013629 100644 --- a/geode-lucene/src/upgradeTest/java/org/apache/geode/cache/lucene/RollingUpgradeReindexShouldBeSuccessfulWhenAllServersRollToCurrentVersion.java +++ b/geode-lucene/src/upgradeTest/java/org/apache/geode/cache/lucene/RollingUpgradeReindexShouldBeSuccessfulWhenAllServersRollToCurrentVersion.java @@ -96,10 +96,10 @@ public void luceneReindexShouldBeSuccessfulWhenAllServersRollToCurrentVersion() regionName, new int[] {locatorPort}); - AsyncInvocation ai1 = server1 + AsyncInvocation ai1 = server1 .invokeAsync(() -> createLuceneIndexOnExistingRegion(cache, regionName, INDEX_NAME)); - AsyncInvocation ai2 = server2 + AsyncInvocation ai2 = server2 .invokeAsync(() -> createLuceneIndexOnExistingRegion(cache, regionName, INDEX_NAME)); ai1.join(); diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java index ce7d19abc52a..7461bffe3d64 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/WANTestBase.java @@ -1061,11 +1061,11 @@ public static void startSenderInVMs(String senderId, VM... vms) { } public static void startSenderInVMsAsync(String senderId, VM... vms) { - List> tasks = new LinkedList<>(); + List> tasks = new LinkedList<>(); for (VM vm : vms) { tasks.add(vm.invokeAsync(() -> startSender(senderId))); } - for (AsyncInvocation invocation : tasks) { + for (AsyncInvocation invocation : tasks) { try { invocation.await(); } catch (InterruptedException e) { @@ -1076,11 +1076,11 @@ public static void startSenderInVMsAsync(String senderId, VM... vms) { public static void startSenderwithCleanQueuesInVMsAsync(String senderId, VM... vms) { - List> tasks = new LinkedList<>(); + List> tasks = new LinkedList<>(); for (VM vm : vms) { tasks.add(vm.invokeAsync(() -> startSenderwithCleanQueues(senderId))); } - for (AsyncInvocation invocation : tasks) { + for (AsyncInvocation invocation : tasks) { try { invocation.await(); } catch (InterruptedException e) { @@ -1640,11 +1640,11 @@ public static void resumeSender(String senderId) { } public static void stopSenderInVMsAsync(String senderId, VM... vms) { - List> tasks = new LinkedList<>(); + List> tasks = new LinkedList<>(); for (VM vm : vms) { tasks.add(vm.invokeAsync(() -> stopSender(senderId))); } - for (AsyncInvocation invocation : tasks) { + for (AsyncInvocation invocation : tasks) { try { invocation.await(); } catch (InterruptedException e) { @@ -3873,12 +3873,12 @@ public boolean equals(Object obj) { @Override public final void preTearDown() throws Exception { cleanupVM(); - List> invocations = new ArrayList<>(); + List> invocations = new ArrayList<>(); final Host host = getHost(0); for (int i = 0; i < host.getVMCount(); i++) { invocations.add(host.getVM(i).invokeAsync(WANTestBase::cleanupVM)); } - for (AsyncInvocation invocation : invocations) { + for (AsyncInvocation invocation : invocations) { invocation.await(); } } diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDistributedTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDistributedTest.java index 2888323ca53c..b9c6a6d09442 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDistributedTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderDistributedTest.java @@ -620,7 +620,7 @@ public void testPartitionedParallelPropagationHA() throws Exception { startSenderInVMs("ln", vm4, vm5, vm6, vm7); - AsyncInvocation putsToVM7 = + AsyncInvocation putsToVM7 = vm7.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", 5000)); vm2.invoke(() -> await() @@ -628,18 +628,18 @@ public void testPartitionedParallelPropagationHA() throws Exception { "Failure in waiting for at least 10 events to be received by the receiver", true, (getRegionSize(getTestMethodName() + "_PR") > 10)))); - AsyncInvocation killsSenderFromVM4 = vm4.invokeAsync(() -> WANTestBase.killSender()); + AsyncInvocation killsSenderFromVM4 = vm4.invokeAsync(() -> WANTestBase.killSender()); int prevRegionSize = vm2.invoke(() -> WANTestBase.getRegionSize(getTestMethodName() + "_PR")); - AsyncInvocation putsToVM6 = + AsyncInvocation putsToVM6 = vm6.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", 10000)); vm2.invoke(() -> await().untilAsserted(() -> assertEquals( "Failure in waiting for additional 20 events to be received by the receiver ", true, getRegionSize(getTestMethodName() + "_PR") > 20 + prevRegionSize))); - AsyncInvocation killsSenderFromVM5 = vm5.invokeAsync(() -> WANTestBase.killSender()); + AsyncInvocation killsSenderFromVM5 = vm5.invokeAsync(() -> WANTestBase.killSender()); putsToVM7.get(); killsSenderFromVM4.get(); diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_1_DUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_1_DUnitTest.java index 15cd83141c02..ebc2f59859bc 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_1_DUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentParallelGatewaySenderOperation_1_DUnitTest.java @@ -461,10 +461,10 @@ public void testParallelPropagationSenderStartAfterStop() throws Throwable { vm2.invoke(() -> WANTestBase.validateRegionSizeRemainsSame(getTestMethodName() + "_PR", 200)); // start the senders again - AsyncInvocation vm4start = vm4.invokeAsync(() -> WANTestBase.startSender("ln")); - AsyncInvocation vm5start = vm5.invokeAsync(() -> WANTestBase.startSender("ln")); - AsyncInvocation vm6start = vm6.invokeAsync(() -> WANTestBase.startSender("ln")); - AsyncInvocation vm7start = vm7.invokeAsync(() -> WANTestBase.startSender("ln")); + AsyncInvocation vm4start = vm4.invokeAsync(() -> WANTestBase.startSender("ln")); + AsyncInvocation vm5start = vm5.invokeAsync(() -> WANTestBase.startSender("ln")); + AsyncInvocation vm6start = vm6.invokeAsync(() -> WANTestBase.startSender("ln")); + AsyncInvocation vm7start = vm7.invokeAsync(() -> WANTestBase.startSender("ln")); int START_TIMEOUT = 30000; vm4start.getResult(START_TIMEOUT); vm5start.getResult(START_TIMEOUT); @@ -482,7 +482,7 @@ public void testParallelPropagationSenderStartAfterStop() throws Throwable { vm2.invoke(() -> WANTestBase.validateRegionSizeRemainsSame(getTestMethodName() + "_PR", 200)); // SECOND RUN: do some more puts - AsyncInvocation async = + AsyncInvocation async = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", 1000)); async.join(); @@ -573,7 +573,7 @@ public void testParallelPropagationSenderStartAfterStop_Scenario2() throws Excep vm2.invoke(() -> WANTestBase.validateRegionSizeRemainsSame(getTestMethodName() + "_PR", 200)); // SECOND RUN: start async puts on region - AsyncInvocation async = + AsyncInvocation async = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", 5000)); LogWriterUtils.getLogWriter().info("Started high number of puts by async thread"); @@ -662,10 +662,10 @@ public void testParallelPropagationSenderStartAfterStopOnAccessorNode() throws T vm2.invoke(() -> WANTestBase.validateRegionSizeRemainsSame(getTestMethodName() + "_PR", 200)); // start the senders again - AsyncInvocation vm4start = vm4.invokeAsync(() -> WANTestBase.startSender("ln")); - AsyncInvocation vm5start = vm5.invokeAsync(() -> WANTestBase.startSender("ln")); - AsyncInvocation vm6start = vm6.invokeAsync(() -> WANTestBase.startSender("ln")); - AsyncInvocation vm7start = vm7.invokeAsync(() -> WANTestBase.startSender("ln")); + AsyncInvocation vm4start = vm4.invokeAsync(() -> WANTestBase.startSender("ln")); + AsyncInvocation vm5start = vm5.invokeAsync(() -> WANTestBase.startSender("ln")); + AsyncInvocation vm6start = vm6.invokeAsync(() -> WANTestBase.startSender("ln")); + AsyncInvocation vm7start = vm7.invokeAsync(() -> WANTestBase.startSender("ln")); vm4start.join(); vm5start.join(); vm6start.join(); @@ -682,7 +682,7 @@ public void testParallelPropagationSenderStartAfterStopOnAccessorNode() throws T vm2.invoke(() -> WANTestBase.validateRegionSizeRemainsSame(getTestMethodName() + "_PR", 200)); // SECOND RUN: do some more puts - AsyncInvocation async = + AsyncInvocation async = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", 1000)); async.join(); @@ -770,7 +770,7 @@ public void testStartPauseResumeParallelGatewaySender() throws Exception { vm6.invoke(() -> WANTestBase.verifySenderPausedState("ln")); vm7.invoke(() -> WANTestBase.verifySenderPausedState("ln")); - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", 1000)); LogWriterUtils.getLogWriter().info("Started 1000 async puts on local site"); diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentWANPropagation_1_DUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentWANPropagation_1_DUnitTest.java index 07b7121c89f5..dfb8acad813a 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentWANPropagation_1_DUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentWANPropagation_1_DUnitTest.java @@ -270,7 +270,7 @@ public void testReplicatedSerialPropagationWithLocalRegionDestroy() throws Excep () -> WANTestBase.createReplicatedRegion(getUniqueName() + "_RR_2", "ln", isOffHeap())); // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_1", 1000)); // do puts in RR_2 in main thread vm4.invoke(() -> WANTestBase.doPuts(getUniqueName() + "_RR_2", 500)); @@ -340,7 +340,7 @@ public void testReplicatedSerialPropagationWithRemoteRegionDestroy() throws Exce IgnoredException.addIgnoredException(ServerOperationException.class.getName()); // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_1", 100)); // destroy RR_1 in remote site vm2.invoke(() -> WANTestBase.destroyRegion(getUniqueName() + "_RR_1")); @@ -429,7 +429,7 @@ public void testReplicatedSerialPropagationWithRemoteRegionDestroy2() throws Exc vm4.invoke(() -> WANTestBase.doPuts(getUniqueName() + "_RR_2", 1000)); // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_1", 1000)); try { @@ -502,10 +502,10 @@ public void testReplicatedSerialPropagationWithRemoteRegionDestroy3() throws Exc IgnoredException.addIgnoredException(ServerOperationException.class.getName()); // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_1", 1000)); // start puts in RR_2 in another thread - AsyncInvocation inv2 = + AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_2", 1000)); // destroy RR_2 on remote site in the middle vm2.invoke(() -> WANTestBase.destroyRegion(getUniqueName() + "_RR_2")); diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentWANPropagation_2_DUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentWANPropagation_2_DUnitTest.java index 5d07b4286442..7fa0a6084aa2 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentWANPropagation_2_DUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/concurrent/ConcurrentWANPropagation_2_DUnitTest.java @@ -202,10 +202,10 @@ public void testReplicatedSerialPropagationHA() throws Exception { vm7.invoke( () -> WANTestBase.createReplicatedRegion(getUniqueName() + "_RR", "ln", isOffHeap())); - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm5.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR", 10000)); Wait.pause(2000); - AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender()); + AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender()); inv1.join(); inv2.join(); diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/CommonParallelGatewaySenderDUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/CommonParallelGatewaySenderDUnitTest.java index a90c13e8cb4b..c3a2a76246a3 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/CommonParallelGatewaySenderDUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/CommonParallelGatewaySenderDUnitTest.java @@ -340,13 +340,13 @@ public void testPRWithGatewaySenderPersistenceEnabled_Restart() { LogWriterUtils.getLogWriter().info("Created the senders back from the disk store."); // create PR on local site - AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase .createPartitionedRegion(getTestMethodName() + "PR1", "ln", 1, 100, isOffHeap())); - AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase + AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase .createPartitionedRegion(getTestMethodName() + "PR1", "ln", 1, 100, isOffHeap())); - AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase + AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase .createPartitionedRegion(getTestMethodName() + "PR1", "ln", 1, 100, isOffHeap())); - AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase + AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase .createPartitionedRegion(getTestMethodName() + "PR1", "ln", 1, 100, isOffHeap())); try { diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/NewWANConcurrencyCheckForDestroyDUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/NewWANConcurrencyCheckForDestroyDUnitTest.java index 23224f668e9e..8468abb7053c 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/NewWANConcurrencyCheckForDestroyDUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/NewWANConcurrencyCheckForDestroyDUnitTest.java @@ -179,7 +179,7 @@ public void testPutAllEventSequenceOnSerialGatewaySenderWithRR() { Wait.pause(2000); // Perform a put in vm1 - AsyncInvocation asynch1 = + AsyncInvocation asynch1 = vm1.invokeAsync(new CacheSerializableRunnable("Putting an entry in ds1") { @Override @@ -202,7 +202,7 @@ public void run2() throws CacheException { // wait for vm1 to propagate put to vm3 Wait.pause(1000); - AsyncInvocation asynch2 = + AsyncInvocation asynch2 = vm1.invokeAsync(new CacheSerializableRunnable("Putting an entry in ds1") { @Override @@ -289,7 +289,7 @@ public void testPutAllEventSequenceOnSerialGatewaySenderWithPR() { Wait.pause(2000); // Perform a put in vm1 - AsyncInvocation asynch1 = + AsyncInvocation asynch1 = vm1.invokeAsync(new CacheSerializableRunnable("Putting an entry in ds1") { @Override @@ -312,7 +312,7 @@ public void run2() throws CacheException { // wait for vm1 to propagate put to vm3 Wait.pause(1000); - AsyncInvocation asynch2 = + AsyncInvocation asynch2 = vm1.invokeAsync(new CacheSerializableRunnable("Putting an entry in ds1") { @Override @@ -420,7 +420,7 @@ public void run2() throws CacheException { // wait for vm4 to have later timestamp before sending operation to vm1 Wait.pause(300); - AsyncInvocation asynch = + AsyncInvocation asynch = vm4.invokeAsync(new CacheSerializableRunnable("Putting an entry in ds2 in vm4") { @Override diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/PDXNewWanDUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/PDXNewWanDUnitTest.java index ce7150023233..96c9964f0eda 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/PDXNewWanDUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/PDXNewWanDUnitTest.java @@ -527,7 +527,7 @@ public void testWANPDX_PR_ParallelSender_WithDelayedTypeRegistry() vm3.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + "_PR", null, 0, 4, isOffHeap())); - AsyncInvocation deserializationFuture; + AsyncInvocation deserializationFuture; try { // Delay processing of sending type registry update from vm2 vm2.invoke(() -> { diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPersistenceDUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPersistenceDUnitTest.java index 2228c955f688..bc19b1aeb2c1 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPersistenceDUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPersistenceDUnitTest.java @@ -139,13 +139,13 @@ public void test_DR_PGSPERSISTENCE_VALIDATEQUEUE_Restart_Validate_Receiver() { LogWriterUtils.getLogWriter().info("Created the senders back from the disk store."); // create PR on local site - AsyncInvocation inv1 = vm4.invokeAsync( + AsyncInvocation inv1 = vm4.invokeAsync( () -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", isOffHeap())); - AsyncInvocation inv2 = vm5.invokeAsync( + AsyncInvocation inv2 = vm5.invokeAsync( () -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", isOffHeap())); - AsyncInvocation inv3 = vm6.invokeAsync( + AsyncInvocation inv3 = vm6.invokeAsync( () -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", isOffHeap())); - AsyncInvocation inv4 = vm7.invokeAsync( + AsyncInvocation inv4 = vm7.invokeAsync( () -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", isOffHeap())); try { inv1.join(); @@ -282,16 +282,16 @@ public void test_DRPERSISTENCE_PGSPERSISTENCE_VALIDATEQUEUE_Restart_Validate_Rec LogWriterUtils.getLogWriter().info("Created the senders back from the disk store."); // create PR on local site - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", Scope.DISTRIBUTED_ACK, DataPolicy.PERSISTENT_REPLICATE, isOffHeap())); - AsyncInvocation inv2 = + AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", Scope.DISTRIBUTED_ACK, DataPolicy.PERSISTENT_REPLICATE, isOffHeap())); - AsyncInvocation inv3 = + AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", Scope.DISTRIBUTED_ACK, DataPolicy.PERSISTENT_REPLICATE, isOffHeap())); - AsyncInvocation inv4 = + AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", Scope.DISTRIBUTED_ACK, DataPolicy.PERSISTENT_REPLICATE, isOffHeap())); @@ -459,16 +459,16 @@ public void test_DRPERSISTENCE_PRPERSISTENCE_PGSPERSISTENCE_VALIDATEQUEUE_Restar LogWriterUtils.getLogWriter().info("Created the senders back from the disk store."); // create PR on local site - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", Scope.DISTRIBUTED_ACK, DataPolicy.PERSISTENT_REPLICATE, isOffHeap())); - AsyncInvocation inv2 = + AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", Scope.DISTRIBUTED_ACK, DataPolicy.PERSISTENT_REPLICATE, isOffHeap())); - AsyncInvocation inv3 = + AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", Scope.DISTRIBUTED_ACK, DataPolicy.PERSISTENT_REPLICATE, isOffHeap())); - AsyncInvocation inv4 = + AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", Scope.DISTRIBUTED_ACK, DataPolicy.PERSISTENT_REPLICATE, isOffHeap())); @@ -605,15 +605,17 @@ public void test_DRPERSISTENCE_PGSPERSISTENCE_4NODES_2NODESDOWN_Validate_Receive Thread.sleep(60000); { - AsyncInvocation inv1 = vm7.invokeAsync(() -> ReplicatedRegion_ParallelWANPropagationDUnitTest - .doPuts0(getTestMethodName() + "_RR", 10000)); + AsyncInvocation inv1 = + vm7.invokeAsync(() -> ReplicatedRegion_ParallelWANPropagationDUnitTest + .doPuts0(getTestMethodName() + "_RR", 10000)); Thread.sleep(1000); - AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender()); + AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender()); Thread.sleep(2000); - AsyncInvocation inv3 = vm6.invokeAsync(() -> ReplicatedRegion_ParallelWANPropagationDUnitTest - .doPuts1(getTestMethodName() + "_RR", 10000)); + AsyncInvocation inv3 = + vm6.invokeAsync(() -> ReplicatedRegion_ParallelWANPropagationDUnitTest + .doPuts1(getTestMethodName() + "_RR", 10000)); Thread.sleep(1500); - AsyncInvocation inv4 = vm5.invokeAsync(() -> WANTestBase.killSender()); + AsyncInvocation inv4 = vm5.invokeAsync(() -> WANTestBase.killSender()); try { inv1.join(); inv2.join(); @@ -637,14 +639,15 @@ public void test_DRPERSISTENCE_PGSPERSISTENCE_4NODES_2NODESDOWN_Validate_Receive LogWriterUtils.getLogWriter().info("Created the senders back from the disk store."); - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", Scope.DISTRIBUTED_ACK, DataPolicy.PERSISTENT_REPLICATE, isOffHeap())); - AsyncInvocation inv2 = + AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", "ln", Scope.DISTRIBUTED_ACK, DataPolicy.PERSISTENT_REPLICATE, isOffHeap())); - AsyncInvocation inv3 = vm6.invokeAsync(() -> ReplicatedRegion_ParallelWANPropagationDUnitTest - .doPuts2(getTestMethodName() + "_RR", 15000)); + AsyncInvocation inv3 = + vm6.invokeAsync(() -> ReplicatedRegion_ParallelWANPropagationDUnitTest + .doPuts2(getTestMethodName() + "_RR", 15000)); try { inv1.join(); inv2.join(); diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropagationDUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropagationDUnitTest.java index 7541a368c335..82fd433e25e7 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropagationDUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/ReplicatedRegion_ParallelWANPropagationDUnitTest.java @@ -769,10 +769,11 @@ public void test_DR_PGS_2NODES_1NODESDOWN_Validate_Receiver() throws Exception { /* * ExpectedException exp1 = addExpectedException(CacheClosedException.class .getName()); try { */ - AsyncInvocation inv1 = vm4.invokeAsync(() -> ReplicatedRegion_ParallelWANPropagationDUnitTest - .doPuts0(getTestMethodName() + "_RR", 1000)); + AsyncInvocation inv1 = + vm4.invokeAsync(() -> ReplicatedRegion_ParallelWANPropagationDUnitTest + .doPuts0(getTestMethodName() + "_RR", 1000)); Wait.pause(1000); - AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase.killSender()); + AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase.killSender()); try { inv1.join(); inv2.join(); @@ -845,15 +846,17 @@ public void test_DR_PGS_4NODES_2NODESDOWN_Validate_Receiver() throws Exception { /* * ExpectedException exp1 = addExpectedException(CacheClosedException.class .getName()); try */ { - AsyncInvocation inv1 = vm7.invokeAsync(() -> ReplicatedRegion_ParallelWANPropagationDUnitTest - .doPuts0(getTestMethodName() + "_RR", 10000)); + AsyncInvocation inv1 = + vm7.invokeAsync(() -> ReplicatedRegion_ParallelWANPropagationDUnitTest + .doPuts0(getTestMethodName() + "_RR", 10000)); Thread.sleep(1000); - AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender()); + AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender()); Thread.sleep(2000); - AsyncInvocation inv3 = vm6.invokeAsync(() -> ReplicatedRegion_ParallelWANPropagationDUnitTest - .doPuts1(getTestMethodName() + "_RR", 10000)); + AsyncInvocation inv3 = + vm6.invokeAsync(() -> ReplicatedRegion_ParallelWANPropagationDUnitTest + .doPuts1(getTestMethodName() + "_RR", 10000)); Thread.sleep(1500); - AsyncInvocation inv4 = vm5.invokeAsync(() -> WANTestBase.killSender()); + AsyncInvocation inv4 = vm5.invokeAsync(() -> WANTestBase.killSender()); try { inv1.join(); inv2.join(); diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java index 9a4e45e5d3cc..f08170668349 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/ShutdownAllPersistentGatewaySenderDUnitTest.java @@ -110,18 +110,18 @@ public String description() { vm2.invoke(waitAtShutdownAll); vm3.invoke(waitAtShutdownAll); - AsyncInvocation vm4_future = + AsyncInvocation vm4_future = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", NUM_KEYS)); // ShutdownAll will be suspended at observer, so puts will continue - AsyncInvocation future = shutDownAllMembers(vm2, 2, MAX_WAIT); + AsyncInvocation future = shutDownAllMembers(vm2, 2, MAX_WAIT); future.join(MAX_WAIT); // now restart vm1 with gatewayHub LogWriterUtils.getLogWriter().info("restart in VM2"); vm2.invoke(() -> WANTestBase.createCache(nyPort)); vm3.invoke(() -> WANTestBase.createCache(nyPort)); - AsyncInvocation vm3_future = vm3.invokeAsync(() -> WANTestBase + AsyncInvocation vm3_future = vm3.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap())); vm2.invoke(() -> WANTestBase.createPersistentPartitionedRegion(getTestMethodName() + "_PR", "ln", 1, 100, isOffHeap())); @@ -178,31 +178,33 @@ public String description() { } - private AsyncInvocation shutDownAllMembers(VM vm, final int expectedNumber, final long timeout) { - AsyncInvocation future = vm.invokeAsync(new SerializableRunnable("Shutdown all the members") { + private AsyncInvocation shutDownAllMembers(VM vm, final int expectedNumber, + final long timeout) { + AsyncInvocation future = + vm.invokeAsync(new SerializableRunnable("Shutdown all the members") { - @Override - public void run() { - DistributedSystemConfig config; - AdminDistributedSystemImpl adminDS = null; - try { - config = AdminDistributedSystemFactory - .defineDistributedSystem(cache.getDistributedSystem(), ""); - adminDS = (AdminDistributedSystemImpl) AdminDistributedSystemFactory - .getDistributedSystem(config); - adminDS.connect(); - Set members = adminDS.shutDownAllMembers(timeout); - int num = members == null ? 0 : members.size(); - assertEquals(expectedNumber, num); - } catch (AdminException e) { - throw new RuntimeException(e); - } finally { - if (adminDS != null) { - adminDS.disconnect(); + @Override + public void run() { + DistributedSystemConfig config; + AdminDistributedSystemImpl adminDS = null; + try { + config = AdminDistributedSystemFactory + .defineDistributedSystem(cache.getDistributedSystem(), ""); + adminDS = (AdminDistributedSystemImpl) AdminDistributedSystemFactory + .getDistributedSystem(config); + adminDS.connect(); + Set members = adminDS.shutDownAllMembers(timeout); + int num = members == null ? 0 : members.size(); + assertEquals(expectedNumber, num); + } catch (AdminException e) { + throw new RuntimeException(e); + } finally { + if (adminDS != null) { + adminDS.disconnect(); + } + } } - } - } - }); + }); return future; } diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java index 1632b83306c6..b4a178da8864 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/misc/WanAutoDiscoveryDUnitTest.java @@ -235,7 +235,7 @@ public void test_TK_Recognises_LN_AND_NY() { @Category({WanTest.class}) @Test - public void test_NY_Recognises_TK_AND_HK_Simultaneously() { + public void test_NY_Recognises_TK_AND_HK_Simultaneously() throws InterruptedException { Map> dsVsPort = new HashMap<>(); Set locatorPortsln = new HashSet<>(); @@ -249,8 +249,8 @@ public void test_NY_Recognises_TK_AND_HK_Simultaneously() { vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnLocPort1)); locatorPortsny.add(new InetSocketAddress("localhost", nyLocPort1)); - int AsyncInvocationArrSize = 4; - AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize]; + int asyncInvocationArrSize = 4; + AsyncInvocation[] async = new AsyncInvocation[asyncInvocationArrSize]; Set locatorPortstk = new HashSet<>(); dsVsPort.put(3, locatorPortstk); @@ -277,10 +277,10 @@ public void test_NY_Recognises_TK_AND_HK_Simultaneously() { fail(); } - locatorPortstk.add(new InetSocketAddress("localhost", (Integer) async[0].getReturnValue())); - locatorPortshk.add(new InetSocketAddress("localhost", (Integer) async[1].getReturnValue())); - locatorPortsln.add(new InetSocketAddress("localhost", (Integer) async[2].getReturnValue())); - locatorPortsny.add(new InetSocketAddress("localhost", (Integer) async[3].getReturnValue())); + locatorPortstk.add(new InetSocketAddress("localhost", async[0].get())); + locatorPortshk.add(new InetSocketAddress("localhost", async[1].get())); + locatorPortsln.add(new InetSocketAddress("localhost", async[2].get())); + locatorPortsny.add(new InetSocketAddress("localhost", async[3].get())); final int siteSizeToCheck = dsVsPort.size(); vm0.invoke(() -> WANTestBase.checkAllSiteMetaData(dsVsPort, siteSizeToCheck)); @@ -377,8 +377,8 @@ public void test_RingTopology() { dsVsPort.put(3, site33LocatorsPort); dsVsPort.put(4, site44LocatorsPort); - int AsyncInvocationArrSize = 9; - AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize]; + int asyncInvocationArrSize = 9; + AsyncInvocation[] async = new AsyncInvocation[asyncInvocationArrSize]; async[0] = vm0.invokeAsync( () -> WANTestBase.createLocator(1, ports[0], site1LocatorsPort, site2LocatorsPort)); @@ -441,8 +441,8 @@ public void test_3Sites3Locators() { dsVsPort.put(2, site2LocatorsPort); dsVsPort.put(3, site3LocatorsPort); - int AsyncInvocationArrSize = 9; - AsyncInvocation[] async = new AsyncInvocation[AsyncInvocationArrSize]; + int asyncInvocationArrSize = 9; + AsyncInvocation[] async = new AsyncInvocation[asyncInvocationArrSize]; async[0] = vm0.invokeAsync( () -> WANTestBase.createLocator(1, site1Port1, site1LocatorsPort, site2LocatorsPort)); diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java index 42a4fd207bed..96093b70f5c9 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java @@ -277,10 +277,10 @@ public void testPRWithGatewaySenderPersistenceEnabled_Restart() { logger.info("Created the senders back from the disk store."); // create PR on local site - AsyncInvocation inv1 = vm4.invokeAsync(createPartitionedRegionRunnable()); - AsyncInvocation inv2 = vm5.invokeAsync(createPartitionedRegionRunnable()); - AsyncInvocation inv3 = vm6.invokeAsync(createPartitionedRegionRunnable()); - AsyncInvocation inv4 = vm7.invokeAsync(createPartitionedRegionRunnable()); + AsyncInvocation inv1 = vm4.invokeAsync(createPartitionedRegionRunnable()); + AsyncInvocation inv2 = vm5.invokeAsync(createPartitionedRegionRunnable()); + AsyncInvocation inv3 = vm6.invokeAsync(createPartitionedRegionRunnable()); + AsyncInvocation inv4 = vm7.invokeAsync(createPartitionedRegionRunnable()); try { inv1.join(); @@ -433,13 +433,13 @@ public void testPersistentPRWithGatewaySenderPersistenceEnabled_Restart() { logger.info("Created the senders back from the disk store."); // create PR on local site - AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase + AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase + AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase + AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); try { @@ -559,13 +559,13 @@ public void testPersistentPRWithGatewaySenderPersistenceEnabled_Restart2() { logger.info("Created the senders back from the disk store."); // create PR on local site - AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase + AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase + AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase + AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); try { @@ -719,13 +719,13 @@ public void testPersistentPRWithGatewaySenderPersistenceEnabled_Restart_Scenario logger.info("Created the senders back from the disk store."); // create PR on local site - AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase + AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase + AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase + AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); try { @@ -756,7 +756,8 @@ public void testPersistentPRWithGatewaySenderPersistenceEnabled_Restart_Scenario // ---------------------------------------------------------------------------------------------------- // Dispatcher should be dispatching now. Do some more puts through async thread - AsyncInvocation async1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName(), 1000)); + AsyncInvocation async1 = + vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName(), 1000)); try { async1.join(); } catch (InterruptedException e) { @@ -862,13 +863,13 @@ public void testPersistentPRWithPersistentGatewaySender_Restart_Bug44275() { logger.info("Created the senders back from the disk store."); // create PR on local site - AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase + AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase + AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase + AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); try { @@ -1087,13 +1088,13 @@ public void testPersistentPR_Restart() { // new Object[] { testName, "ln", 1, 100, isOffHeap() }); // create PR on local site - AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase + AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase + AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase + AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); try { @@ -1452,13 +1453,13 @@ public void testPersistentPartitionedRegionWithGatewaySender_Restart() { logger.info("All the senders are now running..."); // create PR on local site - AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase + AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase + AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); - AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase + AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100, isOffHeap())); try { @@ -1593,13 +1594,13 @@ public void testRemoveGatewayFromPersistentRegionOnRestart() throws Throwable { createCacheInVMs(lnPort, vm4, vm5, vm6, vm7); - AsyncInvocation async4 = vm4.invokeAsync(() -> WANTestBase + AsyncInvocation async4 = vm4.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), null, 1, 100, isOffHeap())); - AsyncInvocation async5 = vm5.invokeAsync(() -> WANTestBase + AsyncInvocation async5 = vm5.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), null, 1, 100, isOffHeap())); - AsyncInvocation async6 = vm6.invokeAsync(() -> WANTestBase + AsyncInvocation async6 = vm6.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), null, 1, 100, isOffHeap())); - AsyncInvocation async7 = vm7.invokeAsync(() -> WANTestBase + AsyncInvocation async7 = vm7.invokeAsync(() -> WANTestBase .createPersistentPartitionedRegion(getTestMethodName(), null, 1, 100, isOffHeap())); async7.getResult(30 * 1000); diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPropagationConcurrentOpsDistributedTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPropagationConcurrentOpsDistributedTest.java index 76ff0ab87092..32f957533418 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPropagationConcurrentOpsDistributedTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPropagationConcurrentOpsDistributedTest.java @@ -75,13 +75,13 @@ public void testParallelPropagationWithSingleBucketPR() throws Exception { vm4.invoke(() -> WANTestBase.pauseSender("ln")); vm5.invoke(() -> WANTestBase.pauseSender("ln")); - AsyncInvocation async1 = + AsyncInvocation async1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", 700)); - AsyncInvocation async2 = + AsyncInvocation async2 = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", 1000)); - AsyncInvocation async3 = + AsyncInvocation async3 = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", 800)); - AsyncInvocation async4 = + AsyncInvocation async4 = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", 1000)); async1.join(); @@ -134,13 +134,13 @@ public void testParallelPropagationWithLowNumberOfBuckets() throws Exception { vm4.invoke(() -> WANTestBase.waitForSenderRunningState("ln")); vm5.invoke(() -> WANTestBase.waitForSenderRunningState("ln")); - AsyncInvocation async1 = + AsyncInvocation async1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", 700)); - AsyncInvocation async2 = + AsyncInvocation async2 = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", 1000)); - AsyncInvocation async3 = + AsyncInvocation async3 = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", 800)); - AsyncInvocation async4 = + AsyncInvocation async4 = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_PR", 1000)); async1.join(); diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDistributedTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDistributedTest.java index 7320c0b15a28..2d48a2b828fe 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDistributedTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANStatsDistributedTest.java @@ -451,12 +451,12 @@ public void testPRParallelPropagationWithGroupTransactionEventsSendsBatchesWithC } } - List> asyncInvocations = new ArrayList<>(clients); + List> asyncInvocations = new ArrayList<>(clients); int eventsPerTransaction = shipmentsPerTransaction + 1; for (int i = 0; i < clients; i++) { final int intCustId = i; - AsyncInvocation asyncInvocation = + AsyncInvocation asyncInvocation = vm4.invokeAsync(() -> WANTestBase.doOrderAndShipmentPutsInsideTransactions( customerData.get(intCustId), eventsPerTransaction)); @@ -464,7 +464,7 @@ public void testPRParallelPropagationWithGroupTransactionEventsSendsBatchesWithC } try { - for (AsyncInvocation asyncInvocation : asyncInvocations) { + for (AsyncInvocation asyncInvocation : asyncInvocations) { asyncInvocation.await(); } } catch (InterruptedException e) { diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderAlterOperationsDUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderAlterOperationsDUnitTest.java index c734d0eb82f6..c74d65c5797e 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderAlterOperationsDUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderAlterOperationsDUnitTest.java @@ -233,7 +233,7 @@ public void testSerialGatewaySenderUpdateAttributesWhilePutting() throws Excepti } // Do some puts from both vm4 and vm5 while restarting a sender - AsyncInvocation doPutsInVm4 = + AsyncInvocation doPutsInVm4 = vm4.invokeAsync(() -> doPuts(className + "_RR", 1000)); updateBatchSize(50); @@ -288,7 +288,7 @@ public void testSerialGatewaySenderUpdateGatewayEventFiltersWhilePutting() throw } // Do some puts from both vm4 and vm5 while restarting a sender - AsyncInvocation doPutsInVm4 = + AsyncInvocation doPutsInVm4 = vm4.invokeAsync(() -> doPuts(className + "_RR", 5000)); updateBatchSize(40); diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderDistributedDeadlockDUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderDistributedDeadlockDUnitTest.java index 7767ec53c7cc..823ba5665ec8 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderDistributedDeadlockDUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderDistributedDeadlockDUnitTest.java @@ -69,13 +69,13 @@ public void testPrimarySendersOnDifferentVMsReplicated() throws Exception { // exercise region and gateway operations with different messaging exerciseWANOperations(); - AsyncInvocation invVM4transaction = + AsyncInvocation invVM4transaction = vm4.invokeAsync("doTxPutsAsync", () -> WANTestBase.doTxPuts(getTestMethodName() + "_RR")); - AsyncInvocation invVM5transaction = + AsyncInvocation invVM5transaction = vm5.invokeAsync("doTxPutsAsync", () -> WANTestBase.doTxPuts(getTestMethodName() + "_RR")); - AsyncInvocation invVM4 = + AsyncInvocation invVM4 = vm4.invokeAsync("doPutsAsync", () -> WANTestBase.doPuts(getTestMethodName() + "_RR", 1000)); - AsyncInvocation invVM5 = + AsyncInvocation invVM5 = vm5.invokeAsync("doPutsAsync", () -> WANTestBase.doPuts(getTestMethodName() + "_RR", 1000)); exerciseFunctions(); @@ -110,16 +110,16 @@ public void testPrimarySendersOnDifferentVMsPR() throws Exception { startSerialSenders(); exerciseWANOperations(); - AsyncInvocation invVM4transaction = + AsyncInvocation invVM4transaction = vm4.invokeAsync("doTxPutsPRAsync", () -> SerialGatewaySenderDistributedDeadlockDUnitTest .doTxPutsPR(getTestMethodName() + "_RR", 100, 1000)); - AsyncInvocation invVM5transaction = + AsyncInvocation invVM5transaction = vm5.invokeAsync("doTxPutsPRAsync", () -> SerialGatewaySenderDistributedDeadlockDUnitTest .doTxPutsPR(getTestMethodName() + "_RR", 100, 1000)); - AsyncInvocation invVM4 = + AsyncInvocation invVM4 = vm4.invokeAsync("doPutsAsync", () -> WANTestBase.doPuts(getTestMethodName() + "_RR", 1000)); - AsyncInvocation invVM5 = + AsyncInvocation invVM5 = vm5.invokeAsync("doPutsAsync", () -> WANTestBase.doPuts(getTestMethodName() + "_RR", 1000)); exerciseFunctions(); @@ -152,14 +152,14 @@ public void testPrimarySendersOnDifferentVMsReplicatedSocketPolicy() throws Exce // exercise region and gateway operations with messaging exerciseWANOperations(); - AsyncInvocation invVM4transaction = + AsyncInvocation invVM4transaction = vm4.invokeAsync("doTxPutsAsync", () -> WANTestBase.doTxPuts(getTestMethodName() + "_RR")); - AsyncInvocation invVM5transaction = + AsyncInvocation invVM5transaction = vm5.invokeAsync("doTxPutsAsync", () -> WANTestBase.doTxPuts(getTestMethodName() + "_RR")); - AsyncInvocation invVM4 = + AsyncInvocation invVM4 = vm4.invokeAsync("doPutsAsync", () -> WANTestBase.doPuts(getTestMethodName() + "_RR", 1000)); - AsyncInvocation invVM5 = + AsyncInvocation invVM5 = vm5.invokeAsync("doPutsAsync", () -> WANTestBase.doPuts(getTestMethodName() + "_RR", 1000)); exerciseFunctions(); @@ -189,16 +189,16 @@ public void testPrimarySendersOnDifferentVMsPRSocketPolicy() throws Exception { startSerialSenders(); exerciseWANOperations(); - AsyncInvocation invVM4transaction = + AsyncInvocation invVM4transaction = vm4.invokeAsync("doTxPutsPRAsync", () -> SerialGatewaySenderDistributedDeadlockDUnitTest .doTxPutsPR(getTestMethodName() + "_RR", 100, 1000)); - AsyncInvocation invVM5transaction = + AsyncInvocation invVM5transaction = vm5.invokeAsync("doTxPutsPRAsync", () -> SerialGatewaySenderDistributedDeadlockDUnitTest .doTxPutsPR(getTestMethodName() + "_RR", 100, 1000)); - AsyncInvocation invVM4 = + AsyncInvocation invVM4 = vm4.invokeAsync("doPutsAsync", () -> WANTestBase.doPuts(getTestMethodName() + "_RR", 1000)); - AsyncInvocation invVM5 = + AsyncInvocation invVM5 = vm5.invokeAsync("doPutsAsync", () -> WANTestBase.doPuts(getTestMethodName() + "_RR", 1000)); exerciseFunctions(); diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderOperationsDistributedTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderOperationsDistributedTest.java index 8768da29d8f5..f93a9af82f73 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderOperationsDistributedTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderOperationsDistributedTest.java @@ -233,7 +233,7 @@ public void testStartPauseResumeSerialGatewaySender() throws Exception { vm4.invoke(() -> validateSenderPausedState("ln")); vm5.invoke(() -> validateSenderPausedState("ln")); - AsyncInvocation doPutsInVm4 = + AsyncInvocation doPutsInVm4 = vm4.invokeAsync(() -> doPuts(className + "_RR", 10)); vm4.invoke(() -> resumeSender("ln")); @@ -315,8 +315,8 @@ public void testStopSerialGatewaySender() throws Exception { vm4.invoke(() -> validateSenderStoppedState("ln")); vm5.invoke(() -> validateSenderStoppedState("ln")); - AsyncInvocation startSenderInVm4 = vm4.invokeAsync(() -> startSender("ln")); - AsyncInvocation startSenderInVm5 = vm5.invokeAsync(() -> startSender("ln")); + AsyncInvocation startSenderInVm4 = vm4.invokeAsync(() -> startSender("ln")); + AsyncInvocation startSenderInVm5 = vm5.invokeAsync(() -> startSender("ln")); startSenderInVm4.await(); startSenderInVm5.await(); @@ -392,10 +392,10 @@ public void testRestartSerialGatewaySendersWhilePutting() throws Exception { // do a lot of puts while senders are restarting - AsyncInvocation doPutsInVm7 = vm7.invokeAsync(() -> doPuts(className + "_RR", 5000)); + AsyncInvocation doPutsInVm7 = vm7.invokeAsync(() -> doPuts(className + "_RR", 5000)); - AsyncInvocation startSenderInVm4 = vm4.invokeAsync(() -> startSender("ln")); - AsyncInvocation startSenderInVm5 = vm5.invokeAsync(() -> startSender("ln")); + AsyncInvocation startSenderInVm4 = vm4.invokeAsync(() -> startSender("ln")); + AsyncInvocation startSenderInVm5 = vm5.invokeAsync(() -> startSender("ln")); startSenderInVm4.await(); startSenderInVm5.await(); @@ -455,8 +455,8 @@ public void testSerialGatewaySendersPrintQueueContents() throws Exception { .sum(), greaterThan(0)); - AsyncInvocation resumeSenderInVm4 = vm4.invokeAsync(() -> resumeSender("ln")); - AsyncInvocation resumeSenderInVm5 = vm5.invokeAsync(() -> resumeSender("ln")); + AsyncInvocation resumeSenderInVm4 = vm4.invokeAsync(() -> resumeSender("ln")); + AsyncInvocation resumeSenderInVm5 = vm5.invokeAsync(() -> resumeSender("ln")); resumeSenderInVm4.await(); resumeSenderInVm5.await(); @@ -511,7 +511,7 @@ public void testStopOneSerialGatewaySenderBothPrimary() throws Exception { vm3.invoke(() -> validateRegionSize(className + "_RR", 200)); // Do some puts from both vm4 and vm5 while restarting a sender - AsyncInvocation doPutsInVm4 = + AsyncInvocation doPutsInVm4 = vm4.invokeAsync(() -> doPuts(className + "_RR", 300)); Thread.sleep(10); diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANPersistenceEnabledGatewaySenderDUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANPersistenceEnabledGatewaySenderDUnitTest.java index 4ee14e6b0acd..989910fc244c 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANPersistenceEnabledGatewaySenderDUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANPersistenceEnabledGatewaySenderDUnitTest.java @@ -230,7 +230,7 @@ public void testReplicatedRegionWithGatewaySenderPersistenceEnabled_Restart() { vm5.invoke(() -> WANTestBase.createSenderWithDiskStore("ln", 2, false, 100, 10, false, true, null, secondDStore, true)); logger.info("Created the sender.... in vm5 "); - AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.startSender("ln")); + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.startSender("ln")); logger.info("Started the sender in vm 4"); vm5.invoke(() -> WANTestBase.startSender("ln")); @@ -314,7 +314,7 @@ public void testPersistentReplicatedRegionWithGatewaySenderPersistenceEnabled_Re vm5.invoke(() -> WANTestBase.createPersistentReplicatedRegion(getTestMethodName() + "_RR", "ln", isOffHeap())); - AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.startSender("ln")); + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.startSender("ln")); logger.info("Started the sender in vm 4"); vm5.invoke(() -> WANTestBase.startSender("ln")); @@ -390,7 +390,7 @@ public void testPersistentReplicatedRegionWithGatewaySender_Restart() { vm5.invoke(() -> WANTestBase.startSender("ln")); logger.info("Started the sender in vm 5"); - AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase .createPersistentReplicatedRegion(getTestMethodName() + "_RR", "ln", isOffHeap())); vm5.invoke(() -> WANTestBase.createPersistentReplicatedRegion(getTestMethodName() + "_RR", "ln", isOffHeap())); @@ -477,7 +477,7 @@ public void testPersistentReplicatedRegionWithGatewaySenderPersistenceEnabled_Re vm5.invoke(() -> WANTestBase.createPersistentReplicatedRegion(getTestMethodName() + "_RR", "ln", isOffHeap())); - AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.startSender("ln")); + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.startSender("ln")); logger.info("Started the sender in vm 4"); vm5.invoke(() -> WANTestBase.startSender("ln")); @@ -544,7 +544,7 @@ public void testReplicatedRegionPersistentWanGateway_restartSender_expectAllEven logger.info("Stopped all the senders. "); - AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.startSender("ln")); + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.startSender("ln")); logger.info("Started the sender in vm 4"); vm5.invoke(() -> WANTestBase.startSender("ln")); @@ -610,7 +610,7 @@ public void testReplicatedRegionPersistentWanGateway_restartSenderWithCleanQueue createReceiverInVMs(vm2, vm3); - AsyncInvocation inv1 = vm4.invokeAsync("Starting sender with clean queues", + AsyncInvocation inv1 = vm4.invokeAsync("Starting sender with clean queues", () -> WANTestBase.startSenderwithCleanQueues("ln")); vm5.invoke("Starting sender with clean queues", () -> WANTestBase.startSenderwithCleanQueues("ln")); diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java index 4107b1e9e905..8a07bed9632e 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANPropagationDUnitTest.java @@ -336,7 +336,7 @@ public void testReplicatedSerialPropagationWithLocalRegionDestroy() throws Excep () -> WANTestBase.createReplicatedRegion(getUniqueName() + "_RR_2", "ln", isOffHeap())); // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_1", 1000)); // do puts in RR_2 in main thread vm4.invoke(() -> WANTestBase.doPuts(getUniqueName() + "_RR_2", 500)); @@ -398,7 +398,7 @@ public void testReplicatedSerialPropagationWithRemoteRegionDestroy() throws Exce IgnoredException.addIgnoredException(ServerOperationException.class.getName()); // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_1", 1000)); // destroy RR_1 in remote site vm2.invoke(() -> WANTestBase.destroyRegion(getUniqueName() + "_RR_1")); @@ -480,7 +480,7 @@ public void testReplicatedSerialPropagationWithRemoteRegionDestroy2() throws Exc vm4.invoke(() -> WANTestBase.doPuts(getUniqueName() + "_RR_2", 1000)); // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_1", 1000)); inv1.join(); @@ -545,10 +545,10 @@ public void testReplicatedSerialPropagationWithRemoteRegionDestroy3() throws Exc IgnoredException.addIgnoredException(ServerOperationException.class.getName()); // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_1", 1000)); // start puts in RR_2 in another thread - AsyncInvocation inv2 = + AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_2", 1000)); // destroy RR_2 on remote site in the middle vm2.invoke(() -> WANTestBase.destroyRegion(getUniqueName() + "_RR_2")); @@ -629,7 +629,7 @@ public void testReplicatedSerialPropagationWithRemoteReceiverStopped() throws Ex () -> WANTestBase.createReplicatedRegion(getUniqueName() + "_RR_1", "ln", isOffHeap())); // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_1", 500)); // close cache in remote site. This will automatically kill the remote receivers. vm2.invoke(WANTestBase::closeCache); @@ -671,7 +671,7 @@ public void testReplicatedSerialPropagationWithRemoteReceiverRestarted() throws // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_1", 8000)); // close cache in remote site. This will automatically kill the remote // receivers. @@ -727,7 +727,7 @@ public void testReplicatedSerialPropagationWithRemoteReceiverRestarted_SenderRec () -> WANTestBase.createReplicatedRegion(getUniqueName() + "_RR_1", "ln", isOffHeap())); // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_1", 8000)); // close cache in remote site. This will automatically kill the remote // receivers. @@ -782,7 +782,7 @@ public void testReplicatedSerialPropagationWithRemoteSiteBouncedBack_ReceiverPer () -> WANTestBase.createReplicatedRegion(getUniqueName() + "_RR_1", "ln", isOffHeap())); // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_1", 8000)); // close cache in remote site. This will automatically kill the remote // receivers. @@ -848,7 +848,7 @@ public void testReplicatedSerialPropagationWithRemoteSiteBouncedBackWithMultiple () -> WANTestBase.createReplicatedRegion(getUniqueName() + "_RR_1", "ln", isOffHeap())); // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_1", 8000)); // close cache in remote site. This will automatically kill the remote // receivers. @@ -909,7 +909,7 @@ public void testReplicatedSerialPropagationWithRemoteReceiverRestartedOnOtherNod vm4.invoke(() -> WANTestBase.startSender("ln")); // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR_1", 8000)); // close cache in remote site. This will automatically kill the remote // receivers. @@ -1005,10 +1005,10 @@ public void testReplicatedSerialPropagationHA() throws Exception { vm6.invoke(createReplicatedRegionRunnable()); vm7.invoke(createReplicatedRegionRunnable()); - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm5.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR", 10000)); Wait.pause(2000); - AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender()); + AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender()); inv1.join(); inv2.join(); @@ -1060,7 +1060,7 @@ public void testReplicatedSerialPropagationHA_ReceiverAffinity() throws Exceptio vm4.invoke(createReplicatedRegionRunnable()); vm5.invoke(createReplicatedRegionRunnable()); - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm5.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR", 10000)); LogWriterUtils.getLogWriter().info("Started async puts on local site"); Wait.pause(1000); @@ -1072,7 +1072,7 @@ public void testReplicatedSerialPropagationHA_ReceiverAffinity() throws Exceptio int oldServerPort = (Integer) oldConnectionInfo.get("serverPort"); LogWriterUtils.getLogWriter().info("Got sender to receiver connection information"); - AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender()); + AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender()); inv2.join(); LogWriterUtils.getLogWriter().info("Killed primary sender on local site"); Wait.pause(5000);// give some time for vm5 to take primary charge @@ -1137,7 +1137,7 @@ public void testReplicatedSerialPropagationHA_ReceiverAffinityScenario2() throws vm4.invoke(createReplicatedRegionRunnable()); vm5.invoke(createReplicatedRegionRunnable()); - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm5.invokeAsync(() -> WANTestBase.doPuts(getUniqueName() + "_RR", 10000)); LogWriterUtils.getLogWriter().info("Started async puts on local site"); Wait.pause(1000); @@ -1151,7 +1151,7 @@ public void testReplicatedSerialPropagationHA_ReceiverAffinityScenario2() throws // ---------------------------- KILL vm4 // -------------------------------------- - AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender()); + AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender()); inv2.join(); LogWriterUtils.getLogWriter().info("Killed vm4 (primary sender) on local site"); // ----------------------------------------------------------------------------- diff --git a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANStatsDistributedTest.java b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANStatsDistributedTest.java index 5b23b628b11b..467c10c1e4d2 100644 --- a/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANStatsDistributedTest.java +++ b/geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialWANStatsDistributedTest.java @@ -280,17 +280,17 @@ public void testReplicatedSerialPropagationWithGroupTransactionEventsSendsBatche int entries = entriesPerInvocation * clients; - List> invocations = new ArrayList<>(clients); + List> invocations = new ArrayList<>(clients); for (int i = 0; i < clients; i++) { final int index = i; - AsyncInvocation asyncInvocation = + AsyncInvocation asyncInvocation = vm4.invokeAsync(() -> WANTestBase.doPutsInsideTransactions(regionName, data.get(index), eventsPerTransaction)); invocations.add(asyncInvocation); } try { - for (AsyncInvocation invocation : invocations) { + for (AsyncInvocation invocation : invocations) { invocation.await(); } } catch (InterruptedException e) { @@ -568,7 +568,7 @@ public void testReplicatedSerialPropagationHA() throws Exception { vm6.invoke(() -> WANTestBase.createReplicatedRegion(testName + "_RR", "ln", isOffHeap())); vm7.invoke(() -> WANTestBase.createReplicatedRegion(testName + "_RR", "ln", isOffHeap())); - AsyncInvocation inv1 = vm5.invokeAsync(() -> WANTestBase.doPuts(testName + "_RR", 10000)); + AsyncInvocation inv1 = vm5.invokeAsync(() -> WANTestBase.doPuts(testName + "_RR", 10000)); pause(2000); AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender("ln")); Boolean isKilled = Boolean.FALSE; @@ -578,7 +578,7 @@ public void testReplicatedSerialPropagationHA() throws Exception { fail("Unexpected exception while killing a sender"); } if (!isKilled) { - AsyncInvocation inv3 = vm5.invokeAsync(() -> WANTestBase.killSender("ln")); + AsyncInvocation inv3 = vm5.invokeAsync(() -> WANTestBase.killSender("ln")); inv3.join(); } inv1.join(); @@ -629,9 +629,9 @@ public void testReplicatedSerialPropagationHAWithGroupTransactionEvents() throws vm6.invoke(() -> WANTestBase.createReplicatedRegion(testName + "_RR", "ln", isOffHeap())); vm7.invoke(() -> WANTestBase.createReplicatedRegion(testName + "_RR", "ln", isOffHeap())); - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm6.invokeAsync(() -> WANTestBase.doTxPutsWithRetryIfError(testName + "_RR", 2, 5000, 0)); - AsyncInvocation inv2 = + AsyncInvocation inv2 = vm7.invokeAsync(() -> WANTestBase.doTxPutsWithRetryIfError(testName + "_RR", 2, 5000, 1)); vm2.invoke(() -> await() @@ -646,7 +646,7 @@ public void testReplicatedSerialPropagationHAWithGroupTransactionEvents() throws fail("Unexpected exception while killing a sender"); } if (!isKilled) { - AsyncInvocation inv4 = vm5.invokeAsync(() -> WANTestBase.killSender("ln")); + AsyncInvocation inv4 = vm5.invokeAsync(() -> WANTestBase.killSender("ln")); inv4.join(); } inv1.join(); @@ -783,7 +783,7 @@ public void testReplicatedSerialPropagationWithRemoteRegionDestroy() { startSenderInVMs("ln", vm4, vm5); // start puts in RR_1 in another thread - AsyncInvocation inv1 = + AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(testName + "_RR_1", numEntries)); // destroy RR_1 in remote site vm2.invoke(() -> WANTestBase.destroyRegion(testName + "_RR_1", 5));