This is an automated email from the ASF dual-hosted git repository.
jchen21 pushed a commit to branch feature/GEODE-7681
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/feature/GEODE-7681 by this
push:
new 905edbc Use Region.clear instead of Region.removeAll
905edbc is described below
commit 905edbc7a74ff4e2b94dc98a7cabbaf51ab91eaa
Author: Jianxia Chen <[email protected]>
AuthorDate: Mon Mar 16 13:46:08 2020 -0700
Use Region.clear instead of Region.removeAll
Authored-by: Jianxia Chen <[email protected]>
---
.../cache/PartitionedRegionClearPerformanceDUnitTest.java | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git
a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionClearPerformanceDUnitTest.java
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionClearPerformanceDUnitTest.java
index f9b0cc1..c659982 100644
---
a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionClearPerformanceDUnitTest.java
+++
b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionClearPerformanceDUnitTest.java
@@ -99,7 +99,7 @@ public class PartitionedRegionClearPerformanceDUnitTest
implements Serializable
}
private void assertRegionSizeOnServer(int size) {
- server1.invoke(()-> {
+ server1.invoke(() -> {
Region region = ClusterStartupRule.getCache().getRegion(regionName);
assertThat(region.size()).isEqualTo(size);
});
@@ -108,9 +108,11 @@ public class PartitionedRegionClearPerformanceDUnitTest
implements Serializable
private void assertRegionAttributesOnServer(int numBuckets, boolean
persistent, int redundancy) {
server1.invoke(() -> {
Region region = ClusterStartupRule.getCache().getRegion(regionName);
-
assertThat(region.getAttributes().getPartitionAttributes().getTotalNumBuckets()).isEqualTo(numBuckets);
+
assertThat(region.getAttributes().getPartitionAttributes().getTotalNumBuckets())
+ .isEqualTo(numBuckets);
assertThat(region.getAttributes().getDataPolicy().withPersistence()).isEqualTo(persistent);
-
assertThat(region.getAttributes().getPartitionAttributes().getRedundantCopies()).isEqualTo(redundancy);
+
assertThat(region.getAttributes().getPartitionAttributes().getRedundantCopies())
+ .isEqualTo(redundancy);
});
}
@@ -119,7 +121,7 @@ public class PartitionedRegionClearPerformanceDUnitTest
implements Serializable
client.invoke(() -> {
Region clientRegion =
ClusterStartupRule.getClientCache().getRegion(regionName);
long startTime = System.currentTimeMillis();
- clientRegion.removeAll(clientRegion.keySet()); // should be
clientRegion.clear();
+ clientRegion.clear();
long endTime = System.currentTimeMillis();
System.out.println(
"Partitioned region with " + numEntries + " entries takes " +
(endTime - startTime)
@@ -130,7 +132,7 @@ public class PartitionedRegionClearPerformanceDUnitTest
implements Serializable
server1.invoke(() -> {
Region region = ClusterStartupRule.getCache().getRegion(regionName);
long startTime = System.currentTimeMillis();
- region.removeAll(region.keySet()); // should be region.clear();
+ region.clear();
long endTime = System.currentTimeMillis();
System.out.println(
"Partitioned region with " + numEntries + " entries takes " +
(endTime - startTime)