kirklund commented on a change in pull request #6036:
URL: https://github.com/apache/geode/pull/6036#discussion_r744004694
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderEventProcessor.java
##########
@@ -78,13 +88,18 @@ protected void initializeMessageQueue(String id, boolean
cleanQueues) {
}
ParallelGatewaySenderQueue queue =
- new ParallelGatewaySenderQueue(sender, targetRs, index, nDispatcher,
cleanQueues);
+ new ParallelGatewaySenderQueue(sender, targetRs, index, nDispatcher,
cleanQueues,
+ recoverQueuesOnly);
- queue.start();
+ if (!recoverQueuesOnly) {
+ queue.start();
+ }
this.queue = queue;
- if (queue.localSize() > 0) {
- queue.notifyEventProcessorIfRequired();
+ if (!recoverQueuesOnly) {
+ if (queue.localSize() > 0) {
+ queue.notifyEventProcessorIfRequired();
+ }
Review comment:
Try to avoid nesting especially when it's unnecessary.
```
if (!recoverQueuesOnly && queue.localSize() > 0) {
queue.notifyEventProcessorIfRequired();
}
```
Or you could extract that conditional to a small private method with a
descriptive name to make it easier to understand. It's hard to figure out what
`!recoverQueuesOnly && queue.localSize() > 0` really means unless I study the
rest of the code in this class.
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlParser.java
##########
@@ -642,6 +661,24 @@ private void startGatewaySender(Attributes atts) {
gatewaySenderFactory.setPersistenceEnabled(Boolean.parseBoolean(enablePersistence));
}
+ String id = atts.getValue(ID);
+ // Gateway-sender startup action
+ InternalGatewaySenderFactory internalGatewaySenderFactory =
+ (InternalGatewaySenderFactory) gatewaySenderFactory;
+ String startupAction = atts.getValue(STARTUP_ACTION);
+ if (startupAction == null) {
+
internalGatewaySenderFactory.setStartupAction(GatewaySenderStartupAction.NONE);
+ } else if (Objects.equals(startupAction,
GatewaySenderStartupAction.START.getAction()) ||
+ Objects.equals(startupAction,
GatewaySenderStartupAction.STOP.getAction()) ||
+ Objects.equals(startupAction,
GatewaySenderStartupAction.PAUSE.getAction())) {
Review comment:
You should probably just the `name()` which is built-in to Java enums:
```
} else if (GatewaySenderStartupAction.START.name().equals(startupAction)) ||
```
##########
File path:
geode-core/src/test/java/org/apache/geode/internal/cache/xmlcache/CacheXmlParserTest.java
##########
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express
+ * or implied. See the License for the specific language governing permissions
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.cache.xmlcache;
+
+import static
org.apache.geode.internal.cache.GemFireCacheImpl.DEFAULT_LOCK_LEASE;
+import static
org.apache.geode.internal.cache.GemFireCacheImpl.DEFAULT_LOCK_TIMEOUT;
+import static
org.apache.geode.internal.cache.GemFireCacheImpl.DEFAULT_SEARCH_TIMEOUT;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.COPY_ON_READ;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.IS_SERVER;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.LOCK_LEASE;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.LOCK_TIMEOUT;
+import static
org.apache.geode.internal.cache.xmlcache.CacheXml.MESSAGE_SYNC_INTERVAL;
+import static
org.apache.geode.internal.cache.xmlcache.CacheXml.REMOTE_DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.SEARCH_TIMEOUT;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.STARTUP_ACTION;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+import org.apache.geode.InternalGemFireException;
+import org.apache.geode.cache.wan.GatewaySenderStartupAction;
+import org.apache.geode.internal.cache.ha.HARegionQueue;
+import org.apache.geode.internal.cache.wan.InternalGatewaySenderFactory;
+
+
+public class CacheXmlParserTest {
+
+ @Mock
+ private CacheCreation cacheCreation;
+
+ @Before
+ public void setUp() {
+ cacheCreation = mock(CacheCreation.class);
+ }
+
+ @Test
+ public void testStartCacheParametersSet() throws SAXException {
+ AttributesImpl attrs = new AttributesImpl();
+ XmlGeneratorUtils.addAttribute(attrs, LOCK_LEASE, "10");
+ XmlGeneratorUtils.addAttribute(attrs, LOCK_TIMEOUT, "15");
+ XmlGeneratorUtils.addAttribute(attrs, SEARCH_TIMEOUT, "20");
+ XmlGeneratorUtils.addAttribute(attrs, MESSAGE_SYNC_INTERVAL, "20");
+ XmlGeneratorUtils.addAttribute(attrs, IS_SERVER, "true");
+ XmlGeneratorUtils.addAttribute(attrs, COPY_ON_READ, "true");
+
+ CacheXmlParser parser = new CacheXmlParser();
+ parser.startElement("http://geode.apache.org/schema/cache", "cache",
"cache", attrs);
+
+ // Check that parameters are set
+ CacheCreation cache = parser.getCacheCreation();
+ assertThat(cache.getLockLease()).isEqualTo(10);
+ assertThat(cache.getLockTimeout()).isEqualTo(15);
+ assertThat(cache.getSearchTimeout()).isEqualTo(20);
+ assertThat(cache.getMessageSyncInterval()).isEqualTo(20);
+ assertThat(cache.isServer()).isTrue();
+ assertThat(cache.getCopyOnRead()).isTrue();
+ // Reset MessageSyncInterval to default value, because it is static
variable
+
HARegionQueue.setMessageSyncInterval(HARegionQueue.DEFAULT_MESSAGE_SYNC_INTERVAL);
+ }
+
+ @Test
+ public void testStartCacheParametersDefaultValues() throws SAXException {
+ AttributesImpl attrs = new AttributesImpl();
+
+ CacheXmlParser parser = new CacheXmlParser();
+ parser.startElement("http://geode.apache.org/schema/cache", "cache",
"cache", attrs);
+
+ // Check that parameters are set to default values
+ CacheCreation cache = parser.getCacheCreation();
+ assertThat(cache.getLockLease()).isEqualTo(DEFAULT_LOCK_LEASE);
+ assertThat(cache.getLockTimeout()).isEqualTo(DEFAULT_LOCK_TIMEOUT);
+ assertThat(cache.getSearchTimeout()).isEqualTo(DEFAULT_SEARCH_TIMEOUT);
+ assertThat(cache.getMessageSyncInterval())
+ .isEqualTo(HARegionQueue.DEFAULT_MESSAGE_SYNC_INTERVAL);
+ assertThat(cache.isServer()).isFalse();
+ assertThat(cache.getCopyOnRead()).isFalse();
+ }
+
+ @Test
+ public void testStartAndEndGatewaySender() throws SAXException {
+ AttributesImpl attrs = new AttributesImpl();
+
+ XmlGeneratorUtils.addAttribute(attrs, REMOTE_DISTRIBUTED_SYSTEM_ID, "1");
+ XmlGeneratorUtils.addAttribute(attrs, CacheXml.ID, "gateway-sender");
+
+ InternalGatewaySenderFactory gatewaySenderFactory =
mock(InternalGatewaySenderFactory.class);
+
when(cacheCreation.createGatewaySenderFactory()).thenReturn(gatewaySenderFactory);
+
+ CacheXmlParser parser = new CacheXmlParser(cacheCreation);
+ parser.startElement("http://geode.apache.org/schema/cache",
"gateway-sender", "gateway-sender",
+ attrs);
+
+ parser.endElement("http://geode.apache.org/schema/cache",
"gateway-sender", "gateway-sender");
+ verify(gatewaySenderFactory).create("gateway-sender", 1);
+ }
+
+ @Test
+ public void testStartGatewaySenderStartupActionParameterStart() throws
SAXException {
+ AttributesImpl attrs = new AttributesImpl();
+ XmlGeneratorUtils.addAttribute(attrs, STARTUP_ACTION, "start");
+
+ InternalGatewaySenderFactory gatewaySenderFactory =
mock(InternalGatewaySenderFactory.class);
+
when(cacheCreation.createGatewaySenderFactory()).thenReturn(gatewaySenderFactory);
+
+ CacheXmlParser parser = new CacheXmlParser(cacheCreation);
+ parser.startElement("http://geode.apache.org/schema/cache",
"gateway-sender", "gateway-sender",
+ attrs);
+
+
verify(gatewaySenderFactory).setStartupAction(GatewaySenderStartupAction.START);
+ }
+
+ @Test
+ public void testStartGatewaySenderStartupActionParameterStop() throws
SAXException {
+ AttributesImpl attrs = new AttributesImpl();
+ XmlGeneratorUtils.addAttribute(attrs, STARTUP_ACTION, "stop");
+
+ InternalGatewaySenderFactory gatewaySenderFactory =
mock(InternalGatewaySenderFactory.class);
+
when(cacheCreation.createGatewaySenderFactory()).thenReturn(gatewaySenderFactory);
+
+ CacheXmlParser parser = new CacheXmlParser(cacheCreation);
+ parser.startElement("http://geode.apache.org/schema/cache",
"gateway-sender", "gateway-sender",
+ attrs);
+
+
verify(gatewaySenderFactory).setStartupAction(GatewaySenderStartupAction.STOP);
+ }
+
+ @Test
+ public void testStartGatewaySenderStartupActionParameterPause() throws
SAXException {
+ AttributesImpl attrs = new AttributesImpl();
+ XmlGeneratorUtils.addAttribute(attrs, STARTUP_ACTION, "pause");
+
+ InternalGatewaySenderFactory gatewaySenderFactory =
mock(InternalGatewaySenderFactory.class);
+
when(cacheCreation.createGatewaySenderFactory()).thenReturn(gatewaySenderFactory);
+
+ CacheXmlParser parser = new CacheXmlParser(cacheCreation);
+ parser.startElement("http://geode.apache.org/schema/cache",
"gateway-sender", "gateway-sender",
+ attrs);
+
+
verify(gatewaySenderFactory).setStartupAction(GatewaySenderStartupAction.PAUSE);
+ }
+
+ @Test
+ public void testStartGatewaySenderStartupActionParameterNull() throws
SAXException {
+ AttributesImpl attrs = new AttributesImpl();
+
+ InternalGatewaySenderFactory gatewaySenderFactory =
mock(InternalGatewaySenderFactory.class);
+
when(cacheCreation.createGatewaySenderFactory()).thenReturn(gatewaySenderFactory);
+
+ CacheXmlParser parser = new CacheXmlParser(cacheCreation);
+ parser.startElement("http://geode.apache.org/schema/cache",
"gateway-sender", "gateway-sender",
+ attrs);
+
+
verify(gatewaySenderFactory).setStartupAction(GatewaySenderStartupAction.NONE);
+ }
+
+ @Test
+ public void testGatewaySenderStartupActionParameterInvalidValue() {
+ AttributesImpl attrs = new AttributesImpl();
+ XmlGeneratorUtils.addAttribute(attrs, CacheXml.ID, "sender1");
+ XmlGeneratorUtils.addAttribute(attrs, STARTUP_ACTION, "pausede");
+
+ InternalGatewaySenderFactory gatewaySenderFactory =
mock(InternalGatewaySenderFactory.class);
+
when(cacheCreation.createGatewaySenderFactory()).thenReturn(gatewaySenderFactory);
+
+ CacheXmlParser parser = new CacheXmlParser(cacheCreation);
+ Exception exception = assertThrows(InternalGemFireException.class,
+ () -> parser.startElement("http://geode.apache.org/schema/cache",
"gateway-sender",
+ "gateway-sender",
+ attrs));
+ assertTrue(exception.getMessage()
+ .contains(
+ "An invalid startup-action value (pausede) was configured for
gateway sender sender1"));
Review comment:
Here's the way you do this with AssertJ:
```
import static org.assertj.core.api.Assertions.catchThrowable;
```
```
Throwable thrown = catchThrowable(() ->
parser.startElement("http://geode.apache.org/schema/cache",
"gateway-sender", "gateway-sender", attrs));
assertThat(thrown)
.isInstanceOf(InternalGemFireException.class)
.hasMessage("An invalid startup-action value (pausede) was configured for
gateway sender sender1");
```
##########
File path:
geode-core/src/test/java/org/apache/geode/internal/cache/xmlcache/CacheXmlParserTest.java
##########
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express
+ * or implied. See the License for the specific language governing permissions
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.cache.xmlcache;
+
+import static
org.apache.geode.internal.cache.GemFireCacheImpl.DEFAULT_LOCK_LEASE;
+import static
org.apache.geode.internal.cache.GemFireCacheImpl.DEFAULT_LOCK_TIMEOUT;
+import static
org.apache.geode.internal.cache.GemFireCacheImpl.DEFAULT_SEARCH_TIMEOUT;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.COPY_ON_READ;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.IS_SERVER;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.LOCK_LEASE;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.LOCK_TIMEOUT;
+import static
org.apache.geode.internal.cache.xmlcache.CacheXml.MESSAGE_SYNC_INTERVAL;
+import static
org.apache.geode.internal.cache.xmlcache.CacheXml.REMOTE_DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.SEARCH_TIMEOUT;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.STARTUP_ACTION;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+import org.apache.geode.InternalGemFireException;
+import org.apache.geode.cache.wan.GatewaySenderStartupAction;
+import org.apache.geode.internal.cache.ha.HARegionQueue;
+import org.apache.geode.internal.cache.wan.InternalGatewaySenderFactory;
+
+
+public class CacheXmlParserTest {
+
+ @Mock
+ private CacheCreation cacheCreation;
+
+ @Before
+ public void setUp() {
+ cacheCreation = mock(CacheCreation.class);
+ }
+
+ @Test
+ public void testStartCacheParametersSet() throws SAXException {
+ AttributesImpl attrs = new AttributesImpl();
Review comment:
Please avoid abbreviations as much as possible and just spell out
`attributes`.
Also, if the APIs that use `attrs` support the interface `Attributes` then
please always declare everything as the interfaces instead of the impl.
##########
File path:
geode-core/src/test/java/org/apache/geode/internal/cache/xmlcache/CacheXmlParserTest.java
##########
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express
+ * or implied. See the License for the specific language governing permissions
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.cache.xmlcache;
+
+import static
org.apache.geode.internal.cache.GemFireCacheImpl.DEFAULT_LOCK_LEASE;
+import static
org.apache.geode.internal.cache.GemFireCacheImpl.DEFAULT_LOCK_TIMEOUT;
+import static
org.apache.geode.internal.cache.GemFireCacheImpl.DEFAULT_SEARCH_TIMEOUT;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.COPY_ON_READ;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.IS_SERVER;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.LOCK_LEASE;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.LOCK_TIMEOUT;
+import static
org.apache.geode.internal.cache.xmlcache.CacheXml.MESSAGE_SYNC_INTERVAL;
+import static
org.apache.geode.internal.cache.xmlcache.CacheXml.REMOTE_DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.SEARCH_TIMEOUT;
+import static org.apache.geode.internal.cache.xmlcache.CacheXml.STARTUP_ACTION;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
Review comment:
Please use `org.assertj.core.api.Assertions.assertThat` instead of the
JUnit Assertions.
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/wan/AbstractGatewaySender.java
##########
@@ -185,6 +187,19 @@
protected volatile ConcurrentLinkedQueue<EntryEventImpl> tmpDroppedEvents =
new ConcurrentLinkedQueue<>();
+
+ /**
+ * Contains wan replication events that were dropped by parallel gateway
senders.
+ * Activate this hook by setting system property
<code>ENABLE_TEST_HOOK_TEMP_DROPPED_EVENTS</code>
+ */
+ private volatile ConcurrentLinkedQueue<EntryEventImpl>
testHookTempDroppedEvents;
+
+ /**
+ * Only used for testing purpose. This property enables test hook which
collects all
+ * wan replication events that are dropped by parallel gateway senders.
+ */
+ private static final boolean ENABLE_TEST_HOOK_TEMP_DROPPED_EVENTS =
+ Boolean.getBoolean("enable-test-hook-temp-dropped-events");
Review comment:
Please try to think of some ways to test dropped events without having
to resort to a test hook. Test hooks in the product code should always be the
very last resort. It would be better to refactor the class, wrap it with a
decorator, introduce a factory that can wrap all instances with an optional
decorator, etc.
In general, I recommend very detailed white-box testing at the unit test
level. The system test level (includes dunit/distributed tests) should be lean
more towards higher level black-block testing.
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
##########
@@ -1193,10 +1195,15 @@ public void postCreateRegion() {
* get the ParallelGatewaySender to create the colocated partitioned
region for this
* region.
*/
+ InternalGatewaySender senderImpl = (InternalGatewaySender) sender;
if (sender.isRunning()) {
- AbstractGatewaySender senderImpl = (AbstractGatewaySender) sender;
((ConcurrentParallelGatewaySenderQueue) senderImpl.getQueues()
.toArray(new
RegionQueue[1])[0]).addShadowPartitionedRegionForUserPR(this);
+ } else if (senderImpl.getEventProcessor() == null) {
+ if (senderImpl.getStartupAction() ==
GatewaySenderStartupAction.STOP
+ || sender.isManualStart()) {
Review comment:
The conditionals of this else-if block are kind of convoluted. I
recommend extracting it to a single method with a name that describes it well
and returns a single boolean so that you can rewrite it as:
```
} else if (isManualStartupRequired()) {
senderImpl.recoverInStoppedState();
}
```
I'm not sure if `isManualStartupRequired()` is a good name... I'm just
guessing here.
##########
File path:
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java
##########
@@ -972,15 +968,24 @@ public void
testPersistentPRWithPersistentGatewaySender_Restart_DoOps() {
LogWriterUtils.getLogWriter().info("Created the senders back from the disk
store.");
- // create PR on local site
- vm4.invoke(() ->
WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1,
- 100, isOffHeap()));
- vm5.invoke(() ->
WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1,
- 100, isOffHeap()));
- vm6.invoke(() ->
WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1,
- 100, isOffHeap()));
- vm7.invoke(() ->
WANTestBase.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1,
- 100, isOffHeap()));
+ AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase
+ .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100,
isOffHeap()));
+ AsyncInvocation inv2 = vm5.invokeAsync(() -> WANTestBase
+ .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100,
isOffHeap()));
+ AsyncInvocation inv3 = vm6.invokeAsync(() -> WANTestBase
+ .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100,
isOffHeap()));
+ AsyncInvocation inv4 = vm7.invokeAsync(() -> WANTestBase
+ .createPersistentPartitionedRegion(getTestMethodName(), "ln", 1, 100,
isOffHeap()));
+
+ try {
+ inv1.join();
+ inv2.join();
+ inv3.join();
+ inv4.join();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ fail();
+ }
Review comment:
Please don't catch Exceptions in tests unless you need to assert its
type or message. You just need to make sure the test method has `throws
InterruptedException` (which it does) and then delete the try-catch blocks.
Please make sure that you define the `AsyncInvocation` types as
`AsyncInvocation<Void>` unless they have a return value. Use descriptive names
for these variables and use `await()` instead of `join()`. The javadocs on
`AsyncInvocation` have some good guidelines.
```
AsyncInvocation<Void> createRegionInVm4 = vm4.invokeAsync(() -> WANTestBase
.createPersistentPartitionedRegion(getTestMethodName(), "ln", 1,
100, isOffHeap()));
createRegionInVm4.await();
```
However, in this case you should NOT use `invokeAsync` and
`AsyncInvocations` unless this test has a very specific need to create the
regions asynchronously. It's more common to use this API for spawning remote
threads that are doing region operations asynchronously. So it's probably
better to just synchronously create these regions:
```
import static
org.apache.geode.internal.cache.wan.WANTestBase.createPersistentPartitionedRegion;
vm4.invoke(() -> createPersistentPartitionedRegion(getTestMethodName(),
"ln", 1, 100, isOffHeap()));
vm5.invoke(() -> createPersistentPartitionedRegion(getTestMethodName(),
"ln", 1, 100, isOffHeap()));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]