[
https://issues.apache.org/jira/browse/GEODE-8035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17102753#comment-17102753
]
ASF GitHub Bot commented on GEODE-8035:
---------------------------------------
kirklund commented on a change in pull request #5014:
URL: https://github.com/apache/geode/pull/5014#discussion_r422258242
##########
File path:
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ParallelDiskStoreRecoveryDUnitTest.java
##########
@@ -0,0 +1,171 @@
+/*
+ * 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;
+
+
+import java.util.concurrent.Future;
+import java.util.stream.IntStream;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ClientCacheFactory;
+import org.apache.geode.cache.client.ClientRegionShortcut;
+import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.ExecutorServiceRule;
+import org.apache.geode.test.junit.rules.GfshCommandRule;
+
+public class ParallelDiskStoreRecoveryDUnitTest {
+
+ @Rule
+ public GfshCommandRule gfsh = new GfshCommandRule();
+
+ @Rule
+ public ClusterStartupRule cluster = new ClusterStartupRule();
Review comment:
The Green Team provided a presentation and recommendations for DUnit
tests that result in tests that are easy for other developers to maintain. One
important recommendation is to use the Geode User APIs directly instead of
using any sort of API replacement/wrapper including ClusterStartupRule. See
[The Green
Report](https://docs.google.com/presentation/d/13FrlS6AJQayi5Iyr_jG3c0kqwxPz-aSkEqBOHRSCj_w/edit?usp=sharing)
(if you don't have access please let me know -- I'm happy to share it with
anyone).
Basically, if a Rule or Wrapper hides anything about configuring, starting,
stopping, or doing anything with Geode then we should not use it because it
obscures Geode.
##########
File path:
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ParallelDiskStoreRecoveryDUnitTest.java
##########
@@ -0,0 +1,171 @@
+/*
+ * 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;
+
+
+import java.util.concurrent.Future;
+import java.util.stream.IntStream;
+
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.client.ClientCache;
+import org.apache.geode.cache.client.ClientCacheFactory;
+import org.apache.geode.cache.client.ClientRegionShortcut;
+import org.apache.geode.management.internal.cli.util.CommandStringBuilder;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.rules.ExecutorServiceRule;
+import org.apache.geode.test.junit.rules.GfshCommandRule;
+
+public class ParallelDiskStoreRecoveryDUnitTest {
+
+ @Rule
+ public GfshCommandRule gfsh = new GfshCommandRule();
+
+ @Rule
+ public ClusterStartupRule cluster = new ClusterStartupRule();
+
+ @Rule
+ public ExecutorServiceRule executorServiceRule = new ExecutorServiceRule();
+
+ private MemberVM locator, server1, server2;
Review comment:
Our coding standard has always disallowed declaration of multiple fields
on one line. This may have slipped with Patrick setup spotless for Geode, but
there was never a group discussion on the dev-list to get rid of this style
requirement.
##########
File path:
geode-core/src/test/java/org/apache/geode/internal/cache/GemFireCacheImplTest.java
##########
@@ -620,6 +625,40 @@ public void getCacheServers_isCanonical() {
.isSameAs(gemFireCacheImpl.getCacheServers());
}
+ @Test
+ public void testLockDiskStore() throws InterruptedException {
+ int nThread = 10;
+ String diskStoreName = "MyDiskStore";
+ AtomicInteger nTrue = new AtomicInteger();
+ AtomicInteger nFalse = new AtomicInteger();
+ ExecutorService executorService = Executors.newFixedThreadPool(nThread);
Review comment:
I recommend using ExecutorServiceRule for several reasons. Most
important is that it always performs tearDown (ie shutdownNow) even if the test
blows up before invoking `executorService.shutdown();`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
> Parallel Disk Store Recovery when Cluster Restarts
> --------------------------------------------------
>
> Key: GEODE-8035
> URL: https://issues.apache.org/jira/browse/GEODE-8035
> Project: Geode
> Issue Type: Improvement
> Reporter: Jianxia Chen
> Assignee: Jianxia Chen
> Priority: Major
> Labels: GeodeCommons, GeodeOperationAPI
>
> Currently, when Geode cluster restarts, the disk store recovery is
> serialized. When all regions share the same disk store, the restart process
> is time consuming. To improve the performance, different regions can use
> different disk stores with different disk controllers. And adding parallel
> disk store recovery. This is expected to significantly reduce the time to
> restart Geode cluster.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)